BPF List
 help / color / mirror / Atom feed
From: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>
To: <sashiko-reviews@lists.linux.dev>
Cc: <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v2 5/9] selftests/bpf: Add kfunc __arena and __arena_nullable argument tests
Date: Sun, 26 Jul 2026 04:02:40 +0200	[thread overview]
Message-ID: <DK84T2IP24QC.2ZOOOKY4B7MWU@gmail.com> (raw)
In-Reply-To: <20260726014114.A795D1F000E9@smtp.kernel.org>

On Sun Jul 26, 2026 at 3:41 AM CEST, sashiko-bot wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The `arena_arg_stack` failure test is conditionally compiled out on compilers missing `__BPF_FEATURE_ADDR_SPACE_CAST`, causing a false test suite failure.
> --
>
> --- Patch [5]: [PATCH bpf-next v2 5/9] selftests/bpf: Add kfunc __arena and __arena_nullable argument tests ---
> commit b7abeb2e41481276f90bb3144448d08e3c6e2c96
> Author: Tejun Heo <tj@kernel.org>
>
> selftests/bpf: Add kfunc __arena and __arena_nullable argument tests
>
> This commit adds kfunc arena argument tests to bpf_testmod to exercise
> argument rebasing, various accepted argument forms, and verifier rejections.
>
>> diff --git a/tools/testing/selftests/bpf/progs/arena_kfunc.c b/tools/testing/selftests/bpf/progs/arena_kfunc.c
>> new file mode 100644
>> index 0000000000000..e7250c5197ab4
>> --- /dev/null
>> +++ b/tools/testing/selftests/bpf/progs/arena_kfunc.c
>
> [ ... ]
>
>> +SEC("syscall")
>> +__arch_x86_64
>> +__failure __msg("arena pointer cannot be a stack argument")
>> +int arena_arg_stack(void *ctx)
>> +{
>> +#if defined(__BPF_FEATURE_ADDR_SPACE_CAST)
>> +	bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0);
>> +	bpf_kfunc_arena_stack_arg_test(1, 2, 3, 4, 5, (u64 *)1);
>> +#endif
>> +	return 0;
>> +}
>
> [Severity: Medium]
> Does this conditional compilation cause the test suite to fail on older
> compilers missing __BPF_FEATURE_ADDR_SPACE_CAST?
>
> Because this test is marked with __failure, the test runner expects the
> verifier to reject it. If the macro is not defined, the program compiles
> to just return 0. The verifier will successfully load the empty program,
> causing the test runner to report a failure because the expected rejection
> did not occur.

I think the goal is to not fail compilation, this is fine as a tradeoff.

  reply	other threads:[~2026-07-26  2:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-26  1:30 [PATCH bpf-next v2 0/9] Add arena argument support to kfuncs and struct_ops Kumar Kartikeya Dwivedi
2026-07-26  1:30 ` [PATCH bpf-next v2 1/9] bpf: Support __arena and __arena_nullable kfunc argument suffixes Kumar Kartikeya Dwivedi
2026-07-26  1:47   ` sashiko-bot
2026-07-26  2:01     ` Kumar Kartikeya Dwivedi
2026-07-26  1:30 ` [PATCH bpf-next v2 2/9] bpf: Support __arena and __arena_nullable on struct_ops arguments Kumar Kartikeya Dwivedi
2026-07-26  1:30 ` [PATCH bpf-next v2 3/9] bpf, x86: JIT __arena kfunc argument rebasing Kumar Kartikeya Dwivedi
2026-07-26  2:22   ` bot+bpf-ci
2026-07-26  2:25     ` Kumar Kartikeya Dwivedi
2026-07-26  1:30 ` [PATCH bpf-next v2 4/9] bpf, x86: Convert struct_ops arena arguments in the trampoline Kumar Kartikeya Dwivedi
2026-07-26  1:30 ` [PATCH bpf-next v2 5/9] selftests/bpf: Add kfunc __arena and __arena_nullable argument tests Kumar Kartikeya Dwivedi
2026-07-26  1:41   ` sashiko-bot
2026-07-26  2:02     ` Kumar Kartikeya Dwivedi [this message]
2026-07-26  1:30 ` [PATCH bpf-next v2 6/9] selftests/bpf: Add JIT-sequence tests for __arena kfunc arguments Kumar Kartikeya Dwivedi
2026-07-26  1:44   ` sashiko-bot
2026-07-26  1:31 ` [PATCH bpf-next v2 7/9] selftests/bpf: Add struct_ops __arena and __arena_nullable argument tests Kumar Kartikeya Dwivedi
2026-07-26  1:31 ` [PATCH bpf-next v2 8/9] bpf, x86: Fix stack-passed arguments for indirect trampolines Kumar Kartikeya Dwivedi
2026-07-26  1:51   ` sashiko-bot
2026-07-26  2:05     ` Kumar Kartikeya Dwivedi
2026-07-26  1:31 ` [PATCH bpf-next v2 9/9] selftests/bpf: Test stack-passed struct_ops arena arguments Kumar Kartikeya Dwivedi

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=DK84T2IP24QC.2ZOOOKY4B7MWU@gmail.com \
    --to=memxor@gmail.com \
    --cc=bpf@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox