From: Eduard Zingerman <eddyz87@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>, bpf@vger.kernel.org
Cc: daniel@iogearbox.net, andrii@kernel.org, memxor@gmail.com,
a.s.protopopov@gmail.com
Subject: Re: [PATCH bpf-next 04/17] bpf: Prepare static analysis passes for callx instruction
Date: Wed, 23 Sep 2026 16:10:27 -0700 [thread overview]
Message-ID: <7917b7dbfbc2d206b0b4c22d2352f5b4700125f0.camel@gmail.com> (raw)
In-Reply-To: <20260922011323.1298619-5-alexei.starovoitov@gmail.com>
On Tue, 2026-09-22 at 01:13 +0000, Alexei Starovoitov wrote:
...
> diff --git a/kernel/bpf/liveness.c b/kernel/bpf/liveness.c
> index 44ecdc5b4ec2..5aa2f68d92b3 100644
> --- a/kernel/bpf/liveness.c
> +++ b/kernel/bpf/liveness.c
...
> @@ -394,7 +407,7 @@ bool bpf_stack_slot_alive(struct bpf_verifier_env *env, u32 frameno, u32 half_sp
> /* Get callsite from verifier state, not from instance callchain */
> callsite = q->callsites[i];
>
> - alive = bpf_calls_callback(env, callsite)
> + alive = callee_stack_access_at_callsite(env, callsite)
> ? is_live_before(instance, callsite, rel, half_spi)
> : is_live_before(instance, callsite + 1, rel, half_spi);
> if (alive)
I don't understand this change.
The original reasoning is that callback calling function can call the
callback many times and the callback might access stack slots from
outer frames. Hence is_live_before(... callsite ...).
callx only calls target once.
The rest lgtm.
...
> @@ -1533,7 +1554,8 @@ static void print_subprog_arg_access(struct bpf_verifier_env *env,
> bool has_extra = false;
> u8 cls = BPF_CLASS(insns[idx].code);
> bool is_ldx_stx_call = cls == BPF_LDX || cls == BPF_STX ||
> - insns[idx].code == (BPF_JMP | BPF_CALL);
> + insns[idx].code == (BPF_JMP | BPF_CALL) ||
> + bpf_is_callx(&insns[idx]);
Nit: it was BPF_OP(.code) == BPF_CALL in the other hunk
>
> verbose(env, "%3d: ", idx);
> bpf_verbose_insn(env, &insns[idx]);
...
next prev parent reply other threads:[~2026-09-23 23:10 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 1:13 [PATCH bpf-next 00/17] bpf: Indirect calls of bpf subprogs (callx) Alexei Starovoitov
2026-09-22 1:13 ` [PATCH bpf-next 01/17] bpf: Fix infinite loop in check_max_stack_depth() Alexei Starovoitov
2026-09-22 2:01 ` bot+bpf-ci
2026-09-22 2:56 ` Alexei Starovoitov
2026-09-23 22:35 ` Eduard Zingerman
2026-09-22 1:13 ` [PATCH bpf-next 02/17] selftests/bpf: Test recursion through a global function and a callback Alexei Starovoitov
2026-09-22 1:13 ` [PATCH bpf-next 03/17] bpf: Don't fold loads from insn_array maps into constants Alexei Starovoitov
2026-09-23 22:39 ` Eduard Zingerman
2026-09-23 23:12 ` Alexei Starovoitov
2026-09-24 0:19 ` bot+bpf-ci
2026-09-22 1:13 ` [PATCH bpf-next 04/17] bpf: Prepare static analysis passes for callx instruction Alexei Starovoitov
2026-09-23 23:10 ` Eduard Zingerman [this message]
2026-09-23 23:51 ` Alexei Starovoitov
2026-09-22 1:13 ` [PATCH bpf-next 05/17] bpf: Add callx instruction to call bpf subprogs indirectly Alexei Starovoitov
2026-09-24 0:09 ` Eduard Zingerman
2026-09-22 1:13 ` [PATCH bpf-next 06/17] bpf: Add callx calls to the call graph Alexei Starovoitov
2026-09-22 1:27 ` sashiko-bot
2026-09-22 2:54 ` Alexei Starovoitov
2026-09-22 1:13 ` [PATCH bpf-next 07/17] bpf, x86: Add JIT support for callx Alexei Starovoitov
2026-09-22 1:27 ` sashiko-bot
2026-09-22 2:53 ` Alexei Starovoitov
2026-09-22 1:13 ` [PATCH bpf-next 08/17] bpf, arm64: " Alexei Starovoitov
2026-09-22 15:05 ` Puranjay Mohan
2026-09-22 1:13 ` [PATCH bpf-next 09/17] bpf: Discover subprogs described by func_info Alexei Starovoitov
2026-09-22 1:13 ` [PATCH bpf-next 10/17] bpf: Recognize pointers to functions in read-only maps Alexei Starovoitov
2026-09-22 1:31 ` sashiko-bot
2026-09-22 3:01 ` Alexei Starovoitov
2026-09-24 0:46 ` bot+bpf-ci
2026-09-24 2:12 ` Alexei Starovoitov
2026-09-22 1:13 ` [PATCH bpf-next 11/17] libbpf: Support pointers to static functions in data when linking Alexei Starovoitov
2026-09-22 1:13 ` [PATCH bpf-next 12/17] libbpf: Resolve pointers to functions in read-only data Alexei Starovoitov
2026-09-24 0:33 ` bot+bpf-ci
2026-09-24 2:13 ` Alexei Starovoitov
2026-09-22 1:13 ` [PATCH bpf-next 13/17] libbpf: Treat .data.rel.ro as " Alexei Starovoitov
2026-09-22 1:13 ` [PATCH bpf-next 14/17] libbpf: Support pointers to functions in read-only data in light skeleton Alexei Starovoitov
2026-09-22 2:01 ` bot+bpf-ci
2026-09-22 2:55 ` Alexei Starovoitov
2026-09-22 1:13 ` [PATCH bpf-next 15/17] selftests/bpf: Add tests for callx Alexei Starovoitov
2026-09-24 0:33 ` bot+bpf-ci
2026-09-24 2:13 ` Alexei Starovoitov
2026-09-22 1:13 ` [PATCH bpf-next 16/17] selftests/bpf: Add tests for callx through pointers in read-only data Alexei Starovoitov
2026-09-22 2:01 ` bot+bpf-ci
2026-09-24 0:33 ` bot+bpf-ci
2026-09-22 1:13 ` [PATCH bpf-next 17/17] bpf, docs: Document callx instruction Alexei Starovoitov
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=7917b7dbfbc2d206b0b4c22d2352f5b4700125f0.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=a.s.protopopov@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=memxor@gmail.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