From: bot+bpf-ci@kernel.org
To: jiangfeng@kylinos.cn,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,eddyz87@gmail.com,memxor@gmail.com,martin.lau@linux.dev,song@kernel.org,yonghong.song@linux.dev,jolsa@kernel.org,emil@etsalapatis.com,ihor.solodrai@linux.dev,luke.r.nels@gmail.com,xi.wang@gmail.com,bjorn@kernel.org,pulehui@huawei.com,puranjay@kernel.org,pjw@kernel.org,palmer@dabbelt.com,aou@eecs.berkeley.edu,alex@ghiti.fr,shuah@kernel.org,nathan@kernel.org,ndesaulniers@google.com,morbo@google.com,justinstitt@google.com
Cc: bpf@vger.kernel.org,linux-riscv@lists.infradead.org,linux-kernel@vger.kernel.org,linux-kselftest@vger.kernel.org,llvm@lists.linux.dev,jiangfeng@kylinos.cn,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,clm@meta.com,ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next v2 2/2] selftests/bpf: Enable stack argument tests for RV64
Date: Thu, 13 Aug 2026 08:11:39 +0000 (UTC) [thread overview]
Message-ID: <1dfa8001d720a33be0d34916414f80a04349057cd35e62ba71a8d0ef8528db69@mail.kernel.org> (raw)
In-Reply-To: <20260813-bpf-riscv-stack-args-v2-2-efea8f9b3fe1@kylinos.cn>
[-- Attachment #1: Type: text/plain, Size: 2909 bytes --]
> diff --git a/tools/testing/selftests/bpf/progs/exceptions.c b/tools/testing/selftests/bpf/progs/exceptions.c
> index c8d716fbd4191..bae20f0f247eb 100644
> --- a/tools/testing/selftests/bpf/progs/exceptions.c
> +++ b/tools/testing/selftests/bpf/progs/exceptions.c
> @@ -379,8 +379,9 @@ int exception_bad_assert_range_with(struct __sk_buff *ctx)
> return 1;
> }
>
> -#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) \
> - && defined(__BPF_FEATURE_STACK_ARGUMENT)
> +#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \
> + (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) && \
> + defined(__BPF_FEATURE_STACK_ARGUMENT)
>
> const volatile bool has_stack_arg = true;
Can the code following this guard actually run on RV64?
The block enabled by this guard contains four bpf_throw()-based programs
(exception_throw_stack_arg, exception_throw_after_stack_arg,
exception_throw_subprog_stack_arg, exception_throw_subprog_after_stack_arg)
plus the has_stack_arg flag. bpf_throw is only accepted by the verifier
when the target JIT supports exceptions:
kernel/bpf/verifier.c
if (!bpf_jit_supports_exceptions()) {
RISC-V implements neither bpf_jit_supports_exceptions() nor
arch_bpf_stack_walk() (only arch/x86, arm64, s390 and powerpc do), so both
fall back to the __weak definitions in kernel/bpf/core.c:
bool __weak bpf_jit_supports_exceptions(void) { return false; }
void __weak arch_bpf_stack_walk(...) { }
Consequently exceptions.bpf.o cannot be loaded at all on RV64 - the rest
of exceptions.c is full of bpf_throw() outside this guard - and the test
is already excluded from RV64 runs:
tools/testing/selftests/bpf/DENYLIST.riscv64
# riscv64 deny list for BPF CI and local vmtest
exceptions # JIT does not support exceptions
prog_tests/exceptions.c only consumes has_stack_arg after
exceptions__load() succeeds:
ret = exceptions__load(skel);
if (!ASSERT_OK(ret, "exceptions__load"))
goto done;
...
if (skel->rodata->has_stack_arg) {
RUN_SUCCESS(exception_throw_stack_arg, 56);
so on RV64 the flag is never read. The hunk therefore changes nothing
observable on riscv64 and cannot have been validated there, which
conflicts with the commit subject 'Enable the stack argument selftests for
RV64'. The other seven hunks are genuinely effective; only this one is
not.
Either drop the exceptions.c hunk from this patch (and add it when the
RV64 JIT gains arch_bpf_stack_walk()/bpf_jit_supports_exceptions()), or
state in the changelog that it is deliberately pre-enabled for a future
RV64 exception implementation and remains untested for now.
---
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/31677823910
prev parent reply other threads:[~2026-08-13 8:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 7:18 [PATCH bpf-next v2 0/2] bpf, riscv: Add BPF stack arguments support for RV64 JIT Feng Jiang
2026-08-13 7:18 ` [PATCH bpf-next v2 1/2] " Feng Jiang
2026-08-13 8:25 ` bot+bpf-ci
2026-08-13 11:35 ` Feng Jiang
2026-08-13 7:18 ` [PATCH bpf-next v2 2/2] selftests/bpf: Enable stack argument tests for RV64 Feng Jiang
2026-08-13 8:11 ` bot+bpf-ci [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=1dfa8001d720a33be0d34916414f80a04349057cd35e62ba71a8d0ef8528db69@mail.kernel.org \
--to=bot+bpf-ci@kernel.org \
--cc=alex@ghiti.fr \
--cc=andrii@kernel.org \
--cc=aou@eecs.berkeley.edu \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jiangfeng@kylinos.cn \
--cc=jolsa@kernel.org \
--cc=justinstitt@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=luke.r.nels@gmail.com \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=pulehui@huawei.com \
--cc=puranjay@kernel.org \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=xi.wang@gmail.com \
--cc=yonghong.song@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
all inboxes | Powered by JetHome®