Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753239AbaFXIeJ (ORCPT ); Tue, 24 Jun 2014 04:34:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21012 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751893AbaFXIeH (ORCPT ); Tue, 24 Jun 2014 04:34:07 -0400 Message-ID: <53A937CB.7040309@redhat.com> Date: Tue, 24 Jun 2014 10:33:15 +0200 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alexei Starovoitov CC: Chema Gonzalez , "David S. Miller" , Ingo Molnar , Steven Rostedt , Eric Dumazet , Peter Zijlstra , Arnaldo Carvalho de Melo , Jiri Olsa , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , Kees Cook , Network Development , LKML Subject: Re: [PATCH v2 net-next 0/2] split BPF out of core networking References: <1401692506-7796-1-git-send-email-ast@plumgrid.com> <538C3C94.3080206@redhat.com> <538CAEA6.4060307@redhat.com> <538D8DAA.7090105@redhat.com> <538E319B.3000606@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/23/2014 11:57 PM, Alexei Starovoitov wrote: > On Fri, Jun 20, 2014 at 9:44 AM, Chema Gonzalez wrote: ... >>>> - nop: I'd like to have a nop. Do I know why? Nope. >>> nope. Let's not add unnecessary instructions. >> A valid nop is a useful instruction: padding, filling up arrays of >> sock_filter_int correctly (as in lib/test_bpf.c, where we're currently >> using a "ld #0", which loads zero to register A), and other use cases >> (see http://en.wikipedia.org/wiki/NOP ). > > especially I don't like to add 'nop' instruction. > code==0 to mean 'ld #0' is one of classic BPF ugliness. I think it was probably unintended to be able to have unreachable code e.g. filled with 'nops' where both jt, jf just jump over it, but that quirk we cannot change anymore in the classic checker and have to carry onwards. > We're not filling up arrays with nops in lib/test_bpf.c > Zero is invalid opcode in eBPF and should stay so, since it's > an easy check for humans like me who are looking at eBPF in hex. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/