BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "George Guo" <dongtai.guo@linux.dev>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v1 3/5] selftests/bpf: Enable struct_ops private stack tests for LoongArch
Date: Thu, 26 Nov 2026 06:05:10 +0000	[thread overview]
Message-ID: <sashiko-outbox-234822@kernel.org> (raw)
In-Reply-To: <20261126055355.9967-4-dongtai.guo@linux.dev>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] selftests/bpf: test_private_stack() fails on LoongArch
  lacking JIT support
--

commit a704d33c4d953257fca9dfdc057e22e872b058cc
Author: George Guo <guodongtai@kylinos.cn>

selftests/bpf: Enable struct_ops private stack tests for LoongArch

This commit enables the struct_ops private stack selftests on 64-bit
LoongArch.

> diff --git a/tools/testing/selftests/bpf/prog_tests/struct_ops_private_stack.c b/tools/testing/selftests/bpf/prog_tests/struct_ops_private_stack.c
> index 103179ff8733b..730d5741591c5 100644
> --- a/tools/testing/selftests/bpf/prog_tests/struct_ops_private_stack.c
> +++ b/tools/testing/selftests/bpf/prog_tests/struct_ops_private_stack.c
> @@ -7,7 +7,8 @@
>  #include "struct_ops_private_stack_large.skel.h"
>  
>  #if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__) || \
> -	(defined(__riscv) && __riscv_xlen == 64)
> +	(defined(__riscv) && __riscv_xlen == 64) || \
> +	(defined(__loongarch__) && __loongarch_grlen == 64)
>  static void test_private_stack(void)
>  {
>  	struct struct_ops_private_stack *skel;

[Severity: Medium]
Will test_private_stack() and test_private_stack_recur() fail to load with
-EACCES on 64-bit LoongArch instead of skipping?

Both tests attach struct_ops programs to bpf_testmod_ops3.test_1, for
which st_ops3_check_member() sets prog->aux->priv_stack_requested = true.
arch/loongarch/net/bpf_jit.c does not implement private stack support or
override bpf_jit_supports_private_stack(), so it falls back to the weak
default returning false and check_struct_ops_btf_id() rejects the load:

kernel/bpf/verifier.c:check_struct_ops_btf_id() {
	...
	if (prog->aux->priv_stack_requested && !bpf_jit_supports_private_stack()) {
		verbose(env, "Private stack not supported by jit\n");
		return -EACCES;
	}
	...
}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126055355.9967-1-dongtai.guo@linux.dev?part=3

  reply	other threads:[~2026-11-26  6:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  5:53 [PATCH bpf-next v1 0/5] selftests/bpf: Enable private stack, large stack and arena tests for LoongArch George Guo
2026-11-26  5:53 ` [PATCH bpf-next v1 1/5] selftests/bpf: Use unsigned loop counter in test_buddy_alloc_free George Guo
2026-11-26  5:53 ` [PATCH bpf-next v1 2/5] selftests/bpf: Enable 2 KiB private stack test for LoongArch George Guo
2026-11-26  6:04   ` sashiko-bot
2026-11-26  5:53 ` [PATCH bpf-next v1 3/5] selftests/bpf: Enable struct_ops private stack tests " George Guo
2026-11-26  6:05   ` sashiko-bot [this message]
2026-11-26  5:53 ` [PATCH bpf-next v1 4/5] selftests/bpf: Enable arena LDSX " George Guo
2026-11-26  6:03   ` sashiko-bot
2026-11-26  5:53 ` [PATCH bpf-next v1 5/5] selftests/bpf: Enable arena atomics " George Guo
2026-11-26  6:06   ` sashiko-bot
2026-11-26  6:06 ` [PATCH bpf-next v1 0/5] selftests/bpf: Enable private stack, large stack and arena " Alexei Starovoitov

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=sashiko-outbox-234822@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dongtai.guo@linux.dev \
    --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