[PATCH v6 7/7] selftests/livepatch: Add RISC-V syscall wrapper prefix

From: Shuai Xue

Date: Mon Sep 14 2026 - 05:39:25 EST


From: Wang Han <wanghan@xxxxxxxxxxxxxxxxx>

The syscall livepatch selftest resolves and patches a syscall wrapper
symbol. To use that test for RISC-V livepatch validation, add the
RISC-V FN_PREFIX definition for ARCH_HAS_SYSCALL_WRAPPER.

Without this macro, the syscall livepatch selftest cannot resolve the
RISC-V target symbol, and the syscall-related livepatch test fails on
RISC-V.

Reviewed-by: Marcos Paulo de Souza <mpdesouza@xxxxxxxx>
Reviewed-by: Shuai Xue <xueshuai@xxxxxxxxxxxxxxxxx>
Acked-by: Miroslav Benes <mbenes@xxxxxxx>
Assisted-by: Qoder:Qwen-3.8-MAX-Preview
Signed-off-by: Wang Han <wanghan@xxxxxxxxxxxxxxxxx>
Signed-off-by: Shuai Xue <xueshuai@xxxxxxxxxxxxxxxxx>
---
.../testing/selftests/livepatch/test_modules/test_klp_syscall.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/livepatch/test_modules/test_klp_syscall.c b/tools/testing/selftests/livepatch/test_modules/test_klp_syscall.c
index 08aacc0e14de9..9baa2a5f84c95 100644
--- a/tools/testing/selftests/livepatch/test_modules/test_klp_syscall.c
+++ b/tools/testing/selftests/livepatch/test_modules/test_klp_syscall.c
@@ -24,6 +24,8 @@
#define FN_PREFIX __s390x_
#elif defined(__aarch64__)
#define FN_PREFIX __arm64_
+ #elif defined(__riscv)
+ #define FN_PREFIX __riscv_
#elif defined(__powerpc__)
#define FN_PREFIX
#else
--
2.39.3