From: Vineet Gupta <vineet.gupta@linux.dev>
To: sashiko-reviews@lists.linux.dev, bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v1 3/7] selftests/bpf: report SKIP for arena tests a compiler cannot build
Date: Wed, 28 Oct 2026 09:14:16 -0700 [thread overview]
Message-ID: <40dde029-432a-4794-a491-8f1c9d5a2b4e@linux.dev> (raw)
In-Reply-To: <sashiko-outbox-187262@kernel.org>
On 10/27/26 5:13 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] selftests/bpf: missing __skip_without_arena fallback in jit_insns_arena.c
> --
>
> commit f37e4c1aa3e5f2decfc920dfa156617c4a66522b
> Author: Vineet Gupta <vineet.gupta@linux.dev>
>
> selftests/bpf: report SKIP for arena tests a compiler cannot build
>
> This commit adds a __skip_without_arena macro and #else fallback programs
> to BPF selftest files guarded by __BPF_FEATURE_ADDR_SPACE_CAST so that
> test_progs reports those subtests as skipped when built with a compiler
> that lacks arena address space support.
>
>> diff --git a/tools/testing/selftests/bpf/progs/bpf_misc.h b/tools/testing/selftests/bpf/progs/bpf_misc.h
>> index 1b264480e128f..ed1ed1b5bd097 100644
>> --- a/tools/testing/selftests/bpf/progs/bpf_misc.h
>> +++ b/tools/testing/selftests/bpf/progs/bpf_misc.h
>> @@ -156,6 +160,16 @@
>> #define __success __test_tag("test_expect_success")
>> #define __description(desc) __test_tag("test_description=" desc)
>> #define __skip(reason) __test_tag("test_skip=" reason)
>> +
>> +/*
>> + * Without compiler arena support, report the test as SKIP rather than let it
>> + * pass vacuously or fail to load.
>> + */
>> +#ifdef __BPF_FEATURE_ADDR_SPACE_CAST
>> +#define __skip_without_arena
>> +#else
>> +#define __skip_without_arena __skip("compiler does not support the arena address space")
>> +#endif
> [Severity: Medium]
> Should tools/testing/selftests/bpf/progs/jit_insns_arena.c also receive an
> #else fallback with a dummy arena_unsupported() program marked
> __skip_without_arena?
>
> In tools/testing/selftests/bpf/progs/jit_insns_arena.c, both BPF programs
> in the file (arena_zero_off() and cast_to_user()) are inside a
> __BPF_FEATURE_ADDR_SPACE_CAST guard without an #else branch:
>
> tools/testing/selftests/bpf/progs/jit_insns_arena.c:
> #if defined(__BPF_FEATURE_ADDR_SPACE_CAST)
> SEC("syscall")
> __success __retval(0)
> int arena_zero_off(void *ctx)
> {
> ...
> }
>
> SEC("syscall")
> __success __retval(0)
> int cast_to_user(void *ctx)
> {
> ...
> }
> #endif
>
> char _license[] SEC("license") = "GPL";
>
> When built with a compiler that does not define
> __BPF_FEATURE_ADDR_SPACE_CAST, such as stock bpf-gcc, jit_insns_arena.c
> compiles to an object with zero BPF programs. When test_jit_insns() in
> tools/testing/selftests/bpf/prog_tests/jit_insns.c runs:
>
> test_jit_insns() -> RUN_TESTS(jit_insns_arena) -> test_loader__run_subtests()
>
> it silently executes zero subtests for jit_insns_arena instead of reporting
> a skipped subtest.
Indeed this was a miss because my prev testing baseline (before rebase)
didn't have it.
Added in v2.
Thx,
-Vineet
prev parent reply other threads:[~2026-10-28 16:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 0:04 [PATCH bpf-next v1 3/7] selftests/bpf: report SKIP for arena tests a compiler cannot build Vineet Gupta
2026-10-28 0:13 ` sashiko-bot
2026-10-28 16:14 ` Vineet Gupta [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=40dde029-432a-4794-a491-8f1c9d5a2b4e@linux.dev \
--to=vineet.gupta@linux.dev \
--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