BPF List
 help / color / mirror / Atom feed
From: Vineet Gupta <vineet.gupta@linux.dev>
To: bpf@vger.kernel.org
Cc: Vineet Gupta <vineet.gupta@linux.dev>
Subject: [PATCH bpf-next 0/3] selftests/bpf: unblock bpf-gcc test coverage
Date: Fri, 21 Aug 2026 13:13:13 -0700	[thread overview]
Message-ID: <20260821201316.1059129-1-vineet.gupta@linux.dev> (raw)

When doing some unrelated testing, stumbled upon this. A lot of tests
are skipped run under BPF_GCC due to clang only gate. On top, the test
harness declares them passing/OK.

Patch 1 renames a few placeholders a consistent dummy_test name [NFC].

A sample test with BPF_GCC used to say:

| #587/1 verifier_bswap/cpuv4 is not supported by compiler or jit, use a dummy test:OK
| #587	 verifier_bswap:OK

Patch 2 adds a __skip("reason") annotation so a compile-time gated file
reports SKIP rather than OK, making these gaps visible in test_progs
output.

Now the output changes to

| #587/1 verifier_bswap/cpuv4 is not supported by compiler or jit, use a dummy test:SKIP
| #587	 verifier_bswap:SKIP

Patch 3 augments the clang only gate with a per-feature gate supported
by both the compilers. FWIW the clang half has to stay: clang only
defines __BPF_FEATURE_MOVSX and friends at -mcpu=v4 but assembles the
inline asm at -mcpu=v3 too, so dropping it would remove these tests from
the default test_progs flavour where they run today.

And finally the output now is

| 587/1	 verifier_bswap/BSWAP, 16:OK
| #587/2 verifier_bswap/BSWAP, 16 @unpriv:SKIP
| #587/3 verifier_bswap/BSWAP, 32:OK
| #587/4 verifier_bswap/BSWAP, 32 @unpriv:SKIP
| #587/5 verifier_bswap/BSWAP, 64:OK
| #587/6 verifier_bswap/BSWAP, 64 @unpriv:SKIP
| #587/7 verifier_bswap/bswap16_range:OK
| #587/8 verifier_bswap/bswap32_range:OK
| #587/9 verifier_bswap/bswap64_range:OK
| #587/10 verifier_bswap/be16_range:OK
| #587/11 verifier_bswap/be32_range:OK
| #587/12 verifier_bswap/be64_range:OK
| #587/13 verifier_bswap/le16_range:OK
| #587/14 verifier_bswap/le32_range:OK
| #587/15 verifier_bswap/le64_range:OK
| #587/16 verifier_bswap/BSWAP, reset reg id:OK
| #587	 verifier_bswap:OK (SKIP: 3/16)

Programs per object recovered under BPF_GCC, 124 in total:

  verifier_sdiv                  1 -> 80
  verifier_movsx                 1 -> 17
  verifier_ldsx                  1 -> 14
  verifier_bswap                 1 -> 13
  compute_live_registers        17 -> 19
  verifier_gotol                 1 -> 2
  verifier_iterating_callbacks  34 -> 35

Two things stay clang-only on purpose: the arena tests using
addr_space_cast, and verifier_load_acquire/verifier_store_release. gas
implements neither.

The increased coverage bore fruits right away as I stumbled into a gas
bug: PR gas/3455. Fix is posted however workaround is needed for the
time being.

Built for x86_64 with both clang and bpf-gcc; the per-object counts above
were read back from the generated objects.

Vineet Gupta (3):
  selftests/bpf: name the remaining placeholder programs dummy_test
    [NFC]
  selftests/bpf: report placeholder tests as SKIP, not OK
  selftests/bpf: Enable some of the blocked cpuv4 instruction tests for
    bpf-gcc

 .../testing/selftests/bpf/progs/arena_kfunc.c |  3 ++-
 tools/testing/selftests/bpf/progs/bpf_misc.h  | 10 ++++++++--
 .../bpf/progs/compute_live_registers.c        |  7 +++++++
 .../selftests/bpf/progs/stack_arg_fail.c      |  3 ++-
 .../selftests/bpf/progs/stack_arg_precision.c |  1 +
 .../selftests/bpf/progs/verifier_bswap.c      |  3 ++-
 .../selftests/bpf/progs/verifier_gotol.c      |  1 +
 .../selftests/bpf/progs/verifier_ldsx.c       | 19 ++++++++++++-------
 .../bpf/progs/verifier_load_acquire.c         |  1 +
 .../selftests/bpf/progs/verifier_movsx.c      |  3 ++-
 .../bpf/progs/verifier_private_stack.c        |  1 +
 .../selftests/bpf/progs/verifier_sdiv.c       |  3 ++-
 .../selftests/bpf/progs/verifier_stack_arg.c  |  1 +
 .../bpf/progs/verifier_stack_arg_order.c      |  1 +
 .../bpf/progs/verifier_store_release.c        |  1 +
 tools/testing/selftests/bpf/test_loader.c     |  9 +++++++++
 16 files changed, 53 insertions(+), 14 deletions(-)

-- 
2.53.0-Meta


             reply	other threads:[~2026-08-21 20:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 20:13 Vineet Gupta [this message]
2026-08-21 20:13 ` [PATCH bpf-next 1/3] selftests/bpf: name the remaining placeholder programs dummy_test [NFC] Vineet Gupta
2026-08-24 18:46   ` Eduard Zingerman
2026-08-21 20:13 ` [PATCH bpf-next 2/3] selftests/bpf: report placeholder tests as SKIP, not OK Vineet Gupta
2026-08-21 21:00   ` bot+bpf-ci
2026-08-21 23:48     ` Vineet Gupta
2026-08-24 18:53   ` Eduard Zingerman
2026-08-21 20:13 ` [PATCH bpf-next 3/3] selftests/bpf: Enable some of the blocked cpuv4 instruction tests for bpf-gcc Vineet Gupta
2026-08-21 20:19   ` sashiko-bot
2026-08-21 23:38     ` Vineet Gupta
2026-08-24 19:04   ` Eduard Zingerman

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=20260821201316.1059129-1-vineet.gupta@linux.dev \
    --to=vineet.gupta@linux.dev \
    --cc=bpf@vger.kernel.org \
    /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