public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Edward Cree <ecree@solarflare.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>, netdev@vger.kernel.org
Subject: Re: [RFC PATCH v3 bpf-next 2/5] bpf/verifier: rewrite subprog boundary detection
Date: Tue, 17 Apr 2018 16:48:27 -0700	[thread overview]
Message-ID: <20180417234826.egydr2sg2rewzvyu@ast-mbp> (raw)
In-Reply-To: <99e70dfe-66a1-911a-6616-60eae4ddc689@solarflare.com>

On Fri, Apr 06, 2018 at 06:13:59PM +0100, Edward Cree wrote:
> By storing a subprogno in each insn's aux data, we avoid the need to keep
>  the list of subprog starts sorted or bsearch() it in find_subprog().
> Also, get rid of the weird one-based indexing of subprog numbers.
> 
> Signed-off-by: Edward Cree <ecree@solarflare.com>
> ---
>  include/linux/bpf_verifier.h |   3 +-
>  kernel/bpf/verifier.c        | 284 ++++++++++++++++++++++++++-----------------
>  2 files changed, 177 insertions(+), 110 deletions(-)
> 
> diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
> index 8f70dc181e23..17990dd56e65 100644
> --- a/include/linux/bpf_verifier.h
> +++ b/include/linux/bpf_verifier.h
> @@ -146,6 +146,7 @@ struct bpf_insn_aux_data {
>  		s32 call_imm;			/* saved imm field of call insn */
>  	};
>  	int ctx_field_size; /* the ctx field size for load insn, maybe 0 */
> +	u16 subprogno; /* subprog in which this insn resides */
>  	bool seen; /* this insn was processed by the verifier */
>  };

as I was saying before this is no go.
subprogno is meaningless in the hierarchy of: prog -> func -> bb -> insn
Soon bpf will have libraries and this field would need to become
a pointer back to bb or func structure creating unnecessary circular dependency.

  reply	other threads:[~2018-04-17 23:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-06 17:11 [RFC PATCH v3 bpf-next 0/5] bpf/verifier: subprog/func_call simplifications Edward Cree
2018-04-06 17:13 ` [RFC PATCH v3 bpf-next 1/5] bpf/verifier: store subprog info in struct bpf_subprog_info Edward Cree
2018-04-06 17:13 ` [RFC PATCH v3 bpf-next 2/5] bpf/verifier: rewrite subprog boundary detection Edward Cree
2018-04-17 23:48   ` Alexei Starovoitov [this message]
2018-05-01 20:40     ` Edward Cree
2018-04-06 17:14 ` [RFC PATCH v3 bpf-next 3/5] bpf/verifier: update selftests Edward Cree
2018-04-06 17:14 ` [RFC PATCH v3 bpf-next 4/5] bpf/verifier: use call graph to efficiently check max stack depth Edward Cree
2018-04-10 12:54   ` Jiong Wang
2018-04-06 17:15 ` [RFC PATCH v3 bpf-next 5/5] bpf/verifier: per-register parent pointers Edward Cree
2018-04-10 12:54 ` [RFC PATCH v3 bpf-next 0/5] bpf/verifier: subprog/func_call simplifications Jiong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180417234826.egydr2sg2rewzvyu@ast-mbp \
    --to=alexei.starovoitov@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=ecree@solarflare.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox