From: Edward Cree <ecree@solarflare.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.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, 1 May 2018 21:40:16 +0100 [thread overview]
Message-ID: <2a368af7-4b2c-545f-0e85-826c93d4f58b@solarflare.com> (raw)
In-Reply-To: <20180417234826.egydr2sg2rewzvyu@ast-mbp>
On 18/04/18 00:48, Alexei Starovoitov wrote:
> 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.
I'm afraid I don't follow. Why can't func numbers (and later, bb numbers)
be per-prog? When verifier is linking multiple progs together it will
necessarily have the subprog-info for each prog, and when making cross-
prog calls it'll have to already know which prog it's calling into; I
don't see any reason why the index into a prog's subprog_info array
should become "meaningless" in such a setup.
Besides, subprogno is how the rest of the verifier currently identifies a
func, and in the absence of any indication of how anything different
will be implemented, that's what an incremental patch has to work with.
If you're worried about the SPOT violation from having both
aux->subprogno and subprog_info->start... well, we could actually get
rid of the latter! Uses of it are:
* carving up insn arrays in jit_subprogs(). Could be done based on
aux->subprogno instead (v1 of this series did that)
* checking CALL destination is at start of function. That could be done
by putting a flag in the aux_data to mark "this insn is at the start of
its subprog". Doesn't even need to increase memory usage: it could be
done by ORing a flag (0x8000, say) into aux->subprogno; or we could
replace 'bool seen;' with 'u8 flags;' again with no extra memory used.
* a few verbose() messages.
That would have another nice consequence, in that adjust_subprog_starts()
could go away - another code simplification resulting from use of the
right data structures.
Btw, sorry for delay in responding; got bogged down in some sfc driver
work.
-Ed
next prev parent reply other threads:[~2018-05-01 20:40 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
2018-05-01 20:40 ` Edward Cree [this message]
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=2a368af7-4b2c-545f-0e85-826c93d4f58b@solarflare.com \
--to=ecree@solarflare.com \
--cc=alexei.starovoitov@gmail.com \
--cc=daniel@iogearbox.net \
--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