* [PATCH] selftests/rseq: select only implemented architecture variants
@ 2026-10-14 20:01 Sasha Levin
2026-11-03 13:01 ` Sasha Levin
2026-11-08 12:43 ` [tip: core/rseq] selftests/rseq: Select " tip-bot2 for Sasha Levin
0 siblings, 2 replies; 3+ messages in thread
From: Sasha Levin @ 2026-10-14 20:01 UTC (permalink / raw)
To: Mathieu Desnoyers, Peter Zijlstra
Cc: Sasha Levin, Paul E. McKenney, Boqun Feng, Shuah Khan,
linux-kselftest, linux-kernel
The rseq headers implement a limited set of targets, and only the
little-endian ARM, arm64 and RISC-V variants. Building the suite for
LoongArch or for the unsupported endian variants fails in the
architecture dispatch of rseq.h.
Ask the target compiler which architecture it builds for before
selecting the tests and scripts, so that unsupported targets build,
install and emit an empty runlist through the ordinary lib.mk rules.
Pass USERCFLAGS to the probe as well, since lib.mk expands the
generated program lists before it appends USERCFLAGS to CFLAGS, and
filter out only the linker options that the preprocessor would warn
about. If the compiler cannot be run, select the tests so that the
build fails instead of turning the problem into an empty suite.
This does not add LoongArch support and does not address the remaining
compiler-specific build failures on supported targets.
Fixes: ccba8b64452b ("rseq/selftests: Provide Makefile, scripts, gitignore")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/rseq/Makefile | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/rseq/Makefile b/tools/testing/selftests/rseq/Makefile
index aba6317f6cb8e..6875ab493ed74 100644
--- a/tools/testing/selftests/rseq/Makefile
+++ b/tools/testing/selftests/rseq/Makefile
@@ -18,10 +18,22 @@ LDLIBS += -lpthread -ldl
# still track changes to header files and depend on shared object.
OVERRIDE_TARGETS = 1
-TEST_GEN_PROGS = basic_test basic_percpu_ops_test basic_percpu_ops_mm_cid_test \
+comma := ,
+RSEQ_ARCH_SUPPORTED = $(shell printf '\043if defined(__x86_64__) || defined(__i386__) || \
+ defined(__ARMEL__) || defined(__AARCH64EL__) || \
+ defined(__PPC__) || defined(__mips__) || defined(__s390__) || \
+ defined(__or1k__) || (defined(__riscv) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)\n1\n\043endif\n' | \
+ $(filter-out -fuse-ld=%,$(CC)) $(filter-out -L% -Wl$(comma)%,$(CFLAGS) $(USERCFLAGS)) \
+ -E -P -x c - || echo 1)
+
+TEST_GEN_PROGS = $(if $(filter 1,$(RSEQ_ARCH_SUPPORTED)),$(RSEQ_TEST_GEN_PROGS))
+TEST_GEN_PROGS_EXTENDED = $(if $(filter 1,$(RSEQ_ARCH_SUPPORTED)),$(RSEQ_TEST_GEN_PROGS_EXTENDED))
+TEST_PROGS = $(if $(filter 1,$(RSEQ_ARCH_SUPPORTED)),$(RSEQ_TEST_PROGS))
+
+RSEQ_TEST_GEN_PROGS = basic_test basic_percpu_ops_test basic_percpu_ops_mm_cid_test \
param_test_benchmark param_test_mm_cid_benchmark
-TEST_GEN_PROGS_EXTENDED = librseq.so \
+RSEQ_TEST_GEN_PROGS_EXTENDED = librseq.so \
param_test \
param_test_compare_twice \
param_test_mm_cid \
@@ -31,7 +43,7 @@ TEST_GEN_PROGS_EXTENDED = librseq.so \
slice_test \
check_optimized
-TEST_PROGS = run_param_test.sh run_syscall_errors_test.sh run_legacy_check.sh run_timeslice_test.sh
+RSEQ_TEST_PROGS = run_param_test.sh run_syscall_errors_test.sh run_legacy_check.sh run_timeslice_test.sh
TEST_FILES := settings
base-commit: 4eb2586bd40db27d77cc5b724ca9386ed0c71d53
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/rseq: select only implemented architecture variants
2026-10-14 20:01 [PATCH] selftests/rseq: select only implemented architecture variants Sasha Levin
@ 2026-11-03 13:01 ` Sasha Levin
2026-11-08 12:43 ` [tip: core/rseq] selftests/rseq: Select " tip-bot2 for Sasha Levin
1 sibling, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2026-11-03 13:01 UTC (permalink / raw)
To: Mathieu Desnoyers, Peter Zijlstra
Cc: Paul E. McKenney, Boqun Feng, Shuah Khan, linux-kselftest,
linux-kernel
Ping, this still applies on 7.4-rc1. KernelCI still fails to build
the rseq suite on loongarch (RSEQ_SIG undeclared), since rseq.h has no
loongarch support.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip: core/rseq] selftests/rseq: Select only implemented architecture variants
2026-10-14 20:01 [PATCH] selftests/rseq: select only implemented architecture variants Sasha Levin
2026-11-03 13:01 ` Sasha Levin
@ 2026-11-08 12:43 ` tip-bot2 for Sasha Levin
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Sasha Levin @ 2026-11-08 12:43 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Sasha Levin, Thomas Gleixner, x86, linux-kernel
The following commit has been merged into the core/rseq branch of tip:
Commit-ID: 9ad0f2d93caf9b1b70c3f239e72b241313caa21f
Gitweb: https://git.kernel.org/tip/9ad0f2d93caf9b1b70c3f239e72b241313caa21f
Author: Sasha Levin <sashal@kernel.org>
AuthorDate: Wed, 14 Oct 2026 16:01:57 -04:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Sun, 08 Nov 2026 13:41:53 +01:00
selftests/rseq: Select only implemented architecture variants
The rseq headers implement a limited set of targets, and only the
little-endian ARM, arm64 and RISC-V variants. Building the suite for
LoongArch or for the unsupported endian variants fails in the
architecture dispatch of rseq.h.
Ask the target compiler which architecture it builds for before
selecting the tests and scripts, so that unsupported targets build,
install and emit an empty runlist through the ordinary lib.mk rules.
Pass USERCFLAGS to the probe as well, since lib.mk expands the
generated program lists before it appends USERCFLAGS to CFLAGS, and
filter out only the linker options that the preprocessor would warn
about. If the compiler cannot be run, select the tests so that the
build fails instead of turning the problem into an empty suite.
This does not add LoongArch support and does not address the remaining
compiler-specific build failures on supported targets.
Fixes: ccba8b64452b ("rseq/selftests: Provide Makefile, scripts, gitignore")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20261014200157.1365258-1-sashal@kernel.org
---
tools/testing/selftests/rseq/Makefile | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/rseq/Makefile b/tools/testing/selftests/rseq/Makefile
index 977da55..ce8721e 100644
--- a/tools/testing/selftests/rseq/Makefile
+++ b/tools/testing/selftests/rseq/Makefile
@@ -18,10 +18,22 @@ LDLIBS += -lpthread -ldl
# still track changes to header files and depend on shared object.
OVERRIDE_TARGETS = 1
-TEST_GEN_PROGS = basic_test basic_percpu_ops_test basic_percpu_ops_mm_cid_test \
+comma := ,
+RSEQ_ARCH_SUPPORTED = $(shell printf '\043if defined(__x86_64__) || defined(__i386__) || \
+ defined(__ARMEL__) || defined(__AARCH64EL__) || \
+ defined(__PPC__) || defined(__mips__) || defined(__s390__) || \
+ defined(__or1k__) || (defined(__riscv) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)\n1\n\043endif\n' | \
+ $(filter-out -fuse-ld=%,$(CC)) $(filter-out -L% -Wl$(comma)%,$(CFLAGS) $(USERCFLAGS)) \
+ -E -P -x c - || echo 1)
+
+TEST_GEN_PROGS = $(if $(filter 1,$(RSEQ_ARCH_SUPPORTED)),$(RSEQ_TEST_GEN_PROGS))
+TEST_GEN_PROGS_EXTENDED = $(if $(filter 1,$(RSEQ_ARCH_SUPPORTED)),$(RSEQ_TEST_GEN_PROGS_EXTENDED))
+TEST_PROGS = $(if $(filter 1,$(RSEQ_ARCH_SUPPORTED)),$(RSEQ_TEST_PROGS))
+
+RSEQ_TEST_GEN_PROGS = basic_test basic_percpu_ops_test basic_percpu_ops_mm_cid_test \
param_test_benchmark param_test_mm_cid_benchmark
-TEST_GEN_PROGS_EXTENDED = librseq.so \
+RSEQ_TEST_GEN_PROGS_EXTENDED = librseq.so \
param_test \
param_test_compare_twice \
param_test_mm_cid \
@@ -31,7 +43,7 @@ TEST_GEN_PROGS_EXTENDED = librseq.so \
slice_test \
check_optimized
-TEST_PROGS = run_param_test.sh run_syscall_errors_test.sh run_legacy_check.sh run_timeslice_test.sh
+RSEQ_TEST_PROGS = run_param_test.sh run_syscall_errors_test.sh run_legacy_check.sh run_timeslice_test.sh
TEST_FILES := settings
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-08 12:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14 20:01 [PATCH] selftests/rseq: select only implemented architecture variants Sasha Levin
2026-11-03 13:01 ` Sasha Levin
2026-11-08 12:43 ` [tip: core/rseq] selftests/rseq: Select " tip-bot2 for Sasha Levin
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.