All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Pu Lehui" <pulehui@huaweicloud.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v4 3/3] selftests/bpf: Enable stack argument tests for RV64
Date: Sat, 05 Sep 2026 07:09:11 +0000	[thread overview]
Message-ID: <20260905070911.CAB0D1F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260905070409.4141522-4-pulehui@huaweicloud.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch misses updating the architecture check in `tools/testing/selftests/bpf/progs/exceptions.c`, leaving stack argument exception tests permanently disabled on RV64.
--

commit 064ba72e246734f0b6e1f3e1f7a66bfe6a3a8b0e
Author: Feng Jiang <jiangfeng@kylinos.cn>

selftests/bpf: Enable stack argument tests for RV64
    
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.

> diff --git a/tools/testing/selftests/bpf/progs/stack_arg.c b/tools/testing/selftests/bpf/progs/stack_arg.c
> index 944e3bb603e7e..3e9ed37c57bb9 100644
> --- a/tools/testing/selftests/bpf/progs/stack_arg.c
> +++ b/tools/testing/selftests/bpf/progs/stack_arg.c
> @@ -21,7 +21,8 @@ struct {
>  
>  int timer_result;
>  
> -#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) && \
> +#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;

[Severity: Medium]
Should tools/testing/selftests/bpf/progs/exceptions.c also be updated 
with this new architecture guard?

It looks like the same has_stack_arg guard is used there:

tools/testing/selftests/bpf/progs/exceptions.c:

#if (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)) \
	&& defined(__BPF_FEATURE_STACK_ARGUMENT)

const volatile bool has_stack_arg = true;

Without updating it, the C preprocessor will take the #else branch on RV64,
defining has_stack_arg = false. At runtime, prog_tests/exceptions.c checks 
skel->rodata->has_stack_arg and silently bypasses the stack argument exception 
tests.

Could this be added to ensure the exception tests are not permanently 
disabled on RV64?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260905070409.4141522-1-pulehui@huaweicloud.com?part=3

  reply	other threads:[~2026-09-05  7:09 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-05  7:04 [PATCH bpf-next v4 0/3] Add bpf stack arguments support for RV64 Pu Lehui
2026-09-05  7:04 ` Pu Lehui
2026-09-05  7:04 ` [PATCH bpf-next v4 1/3] riscv, bpf: Remap BPF_REG_0 and RV_REG_TCC Pu Lehui
2026-09-05  7:04   ` Pu Lehui
2026-09-05  7:12   ` sashiko-bot
2026-09-05  7:43     ` Pu Lehui
2026-09-05  8:00   ` bot+bpf-ci
2026-09-05  8:00     ` bot+bpf-ci
2026-09-05  8:11     ` Pu Lehui
2026-09-05  8:11       ` Pu Lehui
2026-09-05  7:04 ` [PATCH bpf-next v4 2/3] riscv, bpf: Add BPF stack arguments support for RV64 JIT Pu Lehui
2026-09-05  7:04   ` Pu Lehui
2026-09-05  8:00   ` bot+bpf-ci
2026-09-05  8:00     ` bot+bpf-ci
2026-09-05  8:15     ` Pu Lehui
2026-09-05  8:15       ` Pu Lehui
2026-09-05  7:04 ` [PATCH bpf-next v4 3/3] selftests/bpf: Enable stack argument tests for RV64 Pu Lehui
2026-09-05  7:04   ` Pu Lehui
2026-09-05  7:09   ` sashiko-bot [this message]
2026-09-05  7:42     ` Pu Lehui
2026-09-05  7:45   ` bot+bpf-ci
2026-09-05  7:45     ` bot+bpf-ci
2026-09-05  8:05     ` Pu Lehui
2026-09-05  8:05       ` Pu Lehui

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=20260905070911.CAB0D1F00A3D@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=pulehui@huaweicloud.com \
    --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 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.