From: "H. Peter Anvin" Subject: Re: [PATCH RFC v4 net-next 01/26] net: filter: add "load 64-bit immediate" eBPF instruction Date: Wed, 13 Aug 2014 14:16:35 -0700 Message-ID: <53EBD5B3.10200@zytor.com> References: <1407916658-8731-1-git-send-email-ast@plumgrid.com> <1407916658-8731-2-git-send-email-ast@plumgrid.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Alexei Starovoitov , Andy Lutomirski Cc: "David S. Miller" , Ingo Molnar , Linus Torvalds , Steven Rostedt , Daniel Borkmann , Chema Gonzalez , Eric Dumazet , Peter Zijlstra , Andrew Morton , Kees Cook , Linux API , Network Development , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: linux-api@vger.kernel.org On 08/13/2014 02:02 PM, Alexei Starovoitov wrote: > On Wed, Aug 13, 2014 at 11:35 AM, Andy Lutomirski wrote: >> >> The compiler can still think of it as a single insn, though, but some >> future compiler might not. > > I think that would be very dangerous. > compiler (user space) and kernel interpreter must have the same > understanding of ISA. > Only at the point of the interface layer. The compiler can treat it as a single instruction internally, the JIT can do peephole optimization, but as long as the instruction stream at the boundary matches the official ISA spec everything is fine. -hpa