From nobody Mon Oct 14 02:49:12 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XRhWw6W9bz5YyhT; Mon, 14 Oct 2024 02:49:16 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XRhWw4GfXz4GST; Mon, 14 Oct 2024 02:49:16 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTPS id 02CZtIt6LMArN0B91ti6vC; Mon, 14 Oct 2024 02:49:15 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id 0B8ztkM9EE0IV0B90traIM; Mon, 14 Oct 2024 02:49:15 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=cI9DsUeN c=1 sm=1 tr=0 ts=670c86ab a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=DAUX931o1VcA:10 a=4yi-b2ezAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=GoqGsIDvfXODEf7dVFkA:9 a=CjuIK1q_8ugA:10 a=TQxA5NB98t1WezocIkIN:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id E626B376; Sun, 13 Oct 2024 19:49:12 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id B82FD289; Sun, 13 Oct 2024 19:49:12 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "Kevin P. Neal" cc: "Gavin D. Howard" , freebsd-arch@freebsd.org, freebsd-hackers@freebsd.org, freebsd-net@freebsd.org, tcpdump-workers@lists.tcpdump.org, tech-net@netbsd.org, Alexander Nasonov Subject: Re: BPF64: proposal of platform-independent hardware-friendly backwards-compatible eBPF alternative In-reply-to: References: <20240910040544.125245ad@nuclight.lan> Comments: In-reply-to "Kevin P. Neal" message dated "Sun, 13 Oct 2024 21:26:57 -0400." List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 13 Oct 2024 19:49:12 -0700 Message-Id: <20241014024912.B82FD289@slippy.cwsent.com> X-CMAE-Envelope: MS4xfP3R1d8d+xMuFawVIUw/ZdwQE6f2+Yq4QZy6QrXvMCDMFOosgfZi6gjWHVKJEl+fAXsZ6m+t4w19e2zicnFc0ugKVAn7V6ut9FaCvjRI32VZdCNAY4jH 3akqkZ4M1Gv306NKOB3RirzwN3RFMGgdYpjb2pqTA3r3PLrEWDyKUMlPGdSgcTLDRHpcuNtBTaY43cUAURWDRTM+H8VdCThyc7wpaZTkcDD0jPW/pDP+Kc3V dfnkzC5YKUonnUCgRnnAFyfZAuIy8uUK1El4dVxuCjOf1UA1tz5IZUW97LNVlnd2UtMcZAZSbsEiJauqYTXtCtV3L5mQjjOAue0SCMhOH9btyY6XEfmxbKbJ XDOKF8ssvIjBrDs7uuyiDi9+adI6yfa5TSfzkuuSsSq0a5yAxuOWufDABU9DvlrIw/S5Qhj5d+VMI/1Tlz78Sc+Oed5sLWjBanyI+vtkklLrGopF7dk= X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4XRhWw4GfXz4GST X-Spamd-Bar: ---- In message , "Kevin P. Neal" writes: > On Tue, Sep 10, 2024 at 02:41:20PM +0000, Gavin D. Howard wrote: > > But the good thing about this is that FreeBSD could use LLVM IR as the > > BPF64 language, which means any language that compiles to LLVM is a > > possible target. > > Please don't do this. > > The LLVM IR language is a moving target. IR that works in one version is > not guaranteed to work in prior versions. There is an upgrade step where > it tries to read in older IR, but writing out older IR is a problem. It > can be solved, I think the DirectX LLVM backend ("DXIL") does this, but I > still suggest you not do this. > > > As for restricting access, I think it would be possible to check the > > instructions in LLVM IR for any unsafe instructions or calls to > > restricted functions. > > > > The downsides: > > > > * Someone would need to write an LLVM analyze pass or whatever they're > > called. Maybe more than one. > > Close. "Analysis pass". > > > * The kernel would need the ability to compile LLVM IR, making LLVM part > > of the Ring 0 domain. > > * Either that, or someone builds an LLVM-to-bytecode translator. > > * But the analysis pass(es) must still live in the kernel. > > LLVM is huge. Really huge. A codebase that large has no business being in > the kernel. An interpreter in the kernel. What could possibly go wrong with that? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0