From: sashiko-bot@kernel.org
To: "Feng Jiang" <jiangfeng@kylinos.cn>
Cc: bpf@vger.kernel.org
Subject: Re: [bpf-next PATCH 2/2] selftests/bpf: Enable stack argument tests for riscv
Date: Wed, 12 Aug 2026 06:28:00 +0000 [thread overview]
Message-ID: <20260812062801.53ECC1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812-bpf-riscv-stack-args-v1-2-67b246806e59@kylinos.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Stack argument selftests are incorrectly enabled for 32-bit RISC-V (RV32) targets, leading to test regressions.
--
--- Patch [2]: [bpf-next PATCH 2/2] selftests/bpf: Enable stack argument tests for riscv ---
commit 4c9f49e3a0c01bc5c673e83a3a3e5b7f61947d45
Author: Feng Jiang <jiangfeng@kylinos.cn>
selftests/bpf: Enable stack argument tests for riscv
This commit adds __TARGET_ARCH_riscv to the architecture guard in all stack
argument selftests so the real test cases are compiled for RISC-V. It keeps
the __BPF_FEATURE_STACK_ARGUMENT gate defined by clang.
Link: https://github.com/llvm/llvm-project/pull/189060
> diff --git a/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c b/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c
> index 8d38aafe66a28..c8540d30e293d 100644
> --- a/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c
> +++ b/tools/testing/selftests/bpf/progs/btf__stack_arg_precision.c
> @@ -4,7 +4,7 @@
> #include <bpf/bpf_helpers.h>
> #include "../test_kmods/bpf_testmod_kfunc.h"
>
> -#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) && \
> +#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || defined(__TARGET_ARCH_riscv)) && \
> defined(__BPF_FEATURE_STACK_ARGUMENT)
[Severity: Medium]
Does this incorrectly enable the tests for 32-bit RISC-V (RV32) as well?
The BPF selftests build system defines __TARGET_ARCH_riscv for both RV32
and RV64, but BPF stack arguments are only supported in the RV64 JIT.
If these tests are compiled and run on RV32, the verifier will likely reject
programs with more than 5 arguments (returning -ENOTSUPP or -EINVAL),
causing test regressions on that architecture.
Could this be restricted to RV64 by using
(defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64) across all of the
modified selftest files?
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260812-bpf-riscv-stack-args-v1-0-67b246806e59@kylinos.cn?part=2
prev parent reply other threads:[~2026-08-12 6:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 6:15 [bpf-next PATCH 0/2] bpf, riscv: Add BPF stack arguments support for RV64 JIT Feng Jiang
2026-08-12 6:15 ` [bpf-next PATCH 1/2] " Feng Jiang
2026-08-12 6:28 ` sashiko-bot
2026-08-12 6:15 ` [bpf-next PATCH 2/2] selftests/bpf: Enable stack argument tests for riscv Feng Jiang
2026-08-12 6:28 ` sashiko-bot [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=20260812062801.53ECC1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=jiangfeng@kylinos.cn \
--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