From: Andrii Nakryiko <andrii@kernel.org>
To: <bpf@vger.kernel.org>, <ast@kernel.org>, <daniel@iogearbox.net>
Cc: <andrii@kernel.org>, <kernel-team@fb.com>
Subject: [PATCH v2 bpf-next 0/3] Refactor verifier prune and jump point handling
Date: Tue, 6 Dec 2022 15:33:42 -0800 [thread overview]
Message-ID: <20221206233345.438540-1-andrii@kernel.org> (raw)
Disentangle prune and jump points in BPF verifier code. They are conceptually
independent but currently coupled together. This small patch set refactors
related code and make it possible to have some instruction marked as pruning
or jump point independently.
Besides just conceptual cleanliness, this allows to remove unnecessary jump
points (saving a tiny bit of performance and memory usage, potentially), and
even more importantly it allows for clean extension of special pruning points,
similarly to how it's done for BPF_FUNC_timer_set_callback. This will be used
by future patches implementing open-coded BPF iterators.
v1->v2:
- clarified path #3 commit message and a comment in the code (John);
- added back mark_jmp_point() to right after subprog call to record
non-linear implicit jump from BPF_EXIT to right after CALL <subprog>.
Andrii Nakryiko (3):
bpf: decouple prune and jump points
bpf: mostly decouple jump history management from is_state_visited()
bpf: remove unnecessary prune and jump points
include/linux/bpf_verifier.h | 1 +
kernel/bpf/verifier.c | 108 ++++++++++++++++++++---------------
2 files changed, 64 insertions(+), 45 deletions(-)
--
2.30.2
next reply other threads:[~2022-12-06 23:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 23:33 Andrii Nakryiko [this message]
2022-12-06 23:33 ` [PATCH v2 bpf-next 1/3] bpf: decouple prune and jump points Andrii Nakryiko
2022-12-06 23:33 ` [PATCH v2 bpf-next 2/3] bpf: mostly decouple jump history management from is_state_visited() Andrii Nakryiko
2022-12-06 23:33 ` [PATCH v2 bpf-next 3/3] bpf: remove unnecessary prune and jump points Andrii Nakryiko
2022-12-07 1:28 ` John Fastabend
2022-12-07 3:17 ` Alexei Starovoitov
2022-12-07 18:36 ` Andrii Nakryiko
2022-12-07 18:39 ` Alexei Starovoitov
2022-12-07 3:30 ` [PATCH v2 bpf-next 0/3] Refactor verifier prune and jump point handling patchwork-bot+netdevbpf
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=20221206233345.438540-1-andrii@kernel.org \
--to=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
/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