mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: George Guo <dongtai.guo@linux.dev>
To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	eddyz87@gmail.com, memxor@gmail.com
Cc: bpf@vger.kernel.org, loongarch@lists.linux.dev,
	linux-kernel@vger.kernel.org, George Guo <guodongtai@kylinos.cn>
Subject: [PATCH bpf-next v1 5/5] selftests/bpf: Enable arena atomics tests for LoongArch
Date: Thu, 26 Nov 2026 14:53:54 +0900	[thread overview]
Message-ID: <20261126055355.9967-6-dongtai.guo@linux.dev> (raw)
In-Reply-To: <20261126055355.9967-1-dongtai.guo@linux.dev>

From: George Guo <guodongtai@kylinos.cn>

As the LoongArch JIT supports arena atomics, add LoongArch to the
architecture guards of the load-acquire and store-release tests in
arena_atomics, and of the spmc and bitmap parallel tests in libarena,
which use atomics on arena too.

With this patch:
  $ sudo ./test_progs -t arena_atomics | tail -1
  Summary: 1/11 PASSED, 0 SKIPPED, 0/0 FAILED

  $ sudo ./test_progs -t libarena | tail -1
  Summary: 2/43 PASSED, 0 SKIPPED, 0/0 FAILED

Signed-off-by: George Guo <guodongtai@kylinos.cn>
---
 .../bpf/libarena/selftests/test_parallel_bitmap.bpf.c          | 1 +
 .../selftests/bpf/libarena/selftests/test_parallel_spmc.bpf.c  | 1 +
 tools/testing/selftests/bpf/progs/arena_atomics.c              | 3 +++
 3 files changed, 5 insertions(+)

diff --git a/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c b/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c
index 017add229bef..722971b1eba8 100644
--- a/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c
+++ b/tools/testing/selftests/bpf/libarena/selftests/test_parallel_bitmap.bpf.c
@@ -24,6 +24,7 @@ static volatile bool test_abort;
 	(defined(__TARGET_ARCH_arm64) || defined(__TARGET_ARCH_x86) || \
 	 defined(__TARGET_ARCH_s390) || \
 	 defined(__TARGET_ARCH_powerpc) ||				  \
+	 defined(__TARGET_ARCH_loongarch) || \
 	 (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64))
 static bool bitmap_tests_enabled(void)
 {
diff --git a/tools/testing/selftests/bpf/libarena/selftests/test_parallel_spmc.bpf.c b/tools/testing/selftests/bpf/libarena/selftests/test_parallel_spmc.bpf.c
index 5fa96eb74095..af577e1e5050 100644
--- a/tools/testing/selftests/bpf/libarena/selftests/test_parallel_spmc.bpf.c
+++ b/tools/testing/selftests/bpf/libarena/selftests/test_parallel_spmc.bpf.c
@@ -70,6 +70,7 @@ static volatile u64 round_steals;
  */
 #if defined(ENABLE_ATOMICS_TESTS) &&		  \
 	(defined(__TARGET_ARCH_arm64) || defined(__TARGET_ARCH_x86) || \
+	 defined(__TARGET_ARCH_loongarch) || \
 	 (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64))
 static bool spmc_tests_enabled(void)
 {
diff --git a/tools/testing/selftests/bpf/progs/arena_atomics.c b/tools/testing/selftests/bpf/progs/arena_atomics.c
index 2a9664f54399..fcb70b984434 100644
--- a/tools/testing/selftests/bpf/progs/arena_atomics.c
+++ b/tools/testing/selftests/bpf/progs/arena_atomics.c
@@ -30,6 +30,7 @@ bool skip_all_tests = true;
 	defined(__BPF_FEATURE_ADDR_SPACE_CAST) && \
 	(defined(__TARGET_ARCH_arm64) || \
 	 defined(__TARGET_ARCH_x86) || \
+	 defined(__TARGET_ARCH_loongarch) || \
 	 (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64) || \
 	 defined(__TARGET_ARCH_s390))
 bool skip_lacq_srel_tests __attribute((__section__(".data"))) = false;
@@ -454,6 +455,7 @@ int load_acquire(const void *ctx)
 	defined(__BPF_FEATURE_ADDR_SPACE_CAST) && \
 	(defined(__TARGET_ARCH_arm64) || \
 	 defined(__TARGET_ARCH_x86) || \
+	 defined(__TARGET_ARCH_loongarch) || \
 	 (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64) || \
 	 defined(__TARGET_ARCH_s390))
 
@@ -508,6 +510,7 @@ int store_release(const void *ctx)
 	defined(__BPF_FEATURE_ADDR_SPACE_CAST) && \
 	(defined(__TARGET_ARCH_arm64) || \
 	 defined(__TARGET_ARCH_x86) || \
+	 defined(__TARGET_ARCH_loongarch) || \
 	 (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64) || \
 	 defined(__TARGET_ARCH_s390))
 
-- 
2.53.0


  parent reply	other threads:[~2026-11-26  5:54 UTC|newest]

Thread overview: 7+ 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 " 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  5:53 ` [PATCH bpf-next v1 3/5] selftests/bpf: Enable struct_ops private stack tests " George Guo
2026-11-26  5:53 ` [PATCH bpf-next v1 4/5] selftests/bpf: Enable arena LDSX " George Guo
2026-11-26  5:53 ` George Guo [this message]
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=20261126055355.9967-6-dongtai.guo@linux.dev \
    --to=dongtai.guo@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=guodongtai@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=memxor@gmail.com \
    /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®