All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vineet Gupta" <vineet.gupta@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 00:13:21 +0000	[thread overview]
Message-ID: <sashiko-outbox-187262@kernel.org> (raw)
In-Reply-To: <20261028000411.4010967-4-vineet.gupta@linux.dev>

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.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261028000411.4010967-1-vineet.gupta@linux.dev?part=3

  reply	other threads:[~2026-10-28  0:13 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 [this message]
2026-10-28 16:14   ` Vineet Gupta

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=sashiko-outbox-187262@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vineet.gupta@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.