[PATCH bpf-next v4 3/3] selftests/bpf: Enable stack argument tests for RV64

bot+bpf-ci at kernel.org bot+bpf-ci at kernel.org
Sat Sep 5 00:45:34 PDT 2026


> Enable the stack argument selftests for RV64. The riscv guard is
> restricted to __riscv_xlen == 64 since stack arguments are only
> supported by the RV64 JIT.
>
> Keep the __BPF_FEATURE_STACK_ARGUMENT gate, defined by clang with
> BPF stack argument support [1].
>
> [1] https://github.com/llvm/llvm-project/pull/189060
>
> Signed-off-by: Feng Jiang <jiangfeng at kylinos.cn>

The changelog says "Enable the stack argument selftests for RV64", but
one arch-gated stack-argument test remains on x86_64/arm64 only.

Exhaustive list of every arch-gated stack-argument test in
tools/testing/selftests/bpf:

  progs/btf__stack_arg_precision.c        updated by this patch
  progs/btf__verifier_stack_arg_order.c   updated by this patch
  progs/stack_arg.c                       updated by this patch
  progs/stack_arg_kfunc.c                 updated by this patch
  progs/stack_arg_precision.c             updated by this patch
  progs/verifier_stack_arg.c              updated by this patch
  progs/verifier_stack_arg_order.c        updated by this patch
  progs/stack_arg_fail.c                  no arch gate - already runs
  progs/exceptions.c:383                  intentionally left alone
  progs/arena_kfunc.c:219-230             not updated, not explained

progs/exceptions.c is correctly left alone: DENYLIST.riscv64 lists
'exceptions' with the comment "JIT does not support exceptions", and
arch/riscv/net/ implements no bpf_jit_supports_exceptions().

progs/arena_kfunc.c is not explained. It gates its stack-argument test
with test_loader arch annotations rather than a preprocessor guard:

  #if defined(__BPF_FEATURE_ADDR_SPACE_CAST) && \
          defined(__BPF_FEATURE_STACK_ARGUMENT)
  SEC("syscall")
  __arch_x86_64
  __arch_arm64
  __failure __msg("arena pointer cannot be a stack argument")
  int arena_arg_stack(void *ctx)

test_loader.c skips any test whose arch mask does not contain the running
arch, so arena_arg_stack stays skipped on RV64 after this patch.

Does anything block it from running on RV64?  bpf_jit_supports_arena()
returns true on riscv64, DENYLIST.riscv64 contains only 'exceptions', and
arena_arg_stack is a __failure test so it only needs the verifier to reach
the "arena pointer cannot be a stack argument" check - which now happens
on RV64 because the preceding commit makes bpf_jit_supports_stack_args()
return true.

Should __arch_riscv64 be added to progs/arena_kfunc.c's arena_arg_stack
(and the #else dummy_test, which carries the same two annotations), or is
there a reason it should stay on x86_64/arm64 only?


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/33952202002


More information about the linux-riscv mailing list