From: sashiko-bot@kernel.org
To: "Jiayuan Chen" <jiayuan.chen@linux.dev>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next v1] selftests/bpf: Fix insn count expectations in chained global subprogs test
Date: Thu, 13 Aug 2026 05:24:08 +0000 [thread overview]
Message-ID: <20260813052408.A2FFD1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260813051635.121670-1-jiayuan.chen@linux.dev>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The newly introduced multi-line comments violate the mandatory BPF kernel comment style by placing text on the same line as the opening `/*`.
--
--- Patch [1]: [PATCH net-next v1] selftests/bpf: Fix insn count expectations in chained global subprogs test ---
commit 0f391b5a2f4f9b30c1e20dfe376da213cfa9c650
Author: Jiayuan Chen <jiayuan.chen@linux.dev>
selftests/bpf: Fix insn count expectations in chained global subprogs test
This commit rewrites the involved subprograms as naked functions with
hand-written instruction sequences using only v1 instructions. This ensures
that the verified instruction counts no longer depend on CPU version or
compiler codegen, resolving failures on the cpuv4 flavor.
Fixes: c2e6c7de8830 ("bpf: Show more useful info in stack depth stats")
> diff --git a/tools/testing/selftests/bpf/progs/verifier_global_subprogs.c b/tools/testing/selftests/bpf/progs/verifier_global_subprogs.c
> index 7b65eea97ebc2..3352dc177ec15 100644
> --- a/tools/testing/selftests/bpf/progs/verifier_global_subprogs.c
> +++ b/tools/testing/selftests/bpf/progs/verifier_global_subprogs.c
> @@ -25,9 +25,22 @@ __noinline long global_bad(void)
> return arr[unkn_idx]; /* BOOM */
> }
>
> -__noinline long global_good(void)
> +/* Insn counts asserted in chained_global_func_calls_success() depend on
> + * the exact instruction sequences of this function and its callers, so
> + * they are written in inline asm to be independent of compiler codegen.
> + */
[Severity: Low]
This isn't a bug, but does this violate the preferred BPF multi-line comment
style? The BPF subsystem guidelines specify that multi-line comments should
have the opening /* on its own line.
> +__naked __noinline long global_good(void)
[ ... ]
> @@ -56,13 +73,30 @@ __msg("subprog 0 (chained_global_func_calls_success) main insns_self 7 insns_tot
> __msg("subprog {{[0-9]+}} (global_calls_good_only) global insns_self 2 insns_total 2 stack")
> __msg("subprog {{[0-9]+}} (global_good) global insns_self 5 insns_total 5 stack")
> __msg("processed 14 insns")
> -int chained_global_func_calls_success(void)
> -{
> - int sum = 0;
> -
> - if (call_dead_subprog)
> - sum += global_dead();
> - return global_calls_good_only() + sum;
> +__naked int chained_global_func_calls_success(void)
> +{
> + /* int sum = 0;
> + * if (call_dead_subprog)
> + * sum += global_dead();
> + * return global_calls_good_only() + sum;
> + *
> + * call_dead_subprog is known false, so 7 insns are processed:
> + * the branch to l0 is always taken and global_dead() is dead code.
> + */
[Severity: Low]
This isn't a bug, but it looks like this comment block also places text on
the same line as the opening /*. Could this be updated to place the /* on
its own line to match the rest of the BPF subsystem?
> + asm volatile (
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260813051635.121670-1-jiayuan.chen@linux.dev?part=1
prev parent reply other threads:[~2026-08-13 5:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 5:16 [PATCH net-next v1] selftests/bpf: Fix insn count expectations in chained global subprogs test Jiayuan Chen
2026-08-13 5:24 ` sashiko-bot [this message]
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=20260813052408.A2FFD1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=jiayuan.chen@linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.