]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
riscv: tests: Make RISCV_KPROBES_KUNIT tristate
authorVivian Wang <wangruikang@iscas.ac.cn>
Mon, 20 Oct 2025 12:23:56 +0000 (20:23 +0800)
committerPaul Walmsley <pjw@kernel.org>
Tue, 28 Oct 2025 00:49:34 +0000 (18:49 -0600)
This disallows KUNIT=m and RISCV_KPROBES_KUNIT=y, which produces these
relocs_check.sh warnings when RELOCATABLE=y:

    WARNING: 3 bad relocations
    ffffffff81e24118 R_RISCV_64        kunit_unary_assert_format
    ffffffff81e24a60 R_RISCV_64        kunit_binary_assert_format
    ffffffff81e269d0 R_RISCV_JUMP_SLOT  __kunit_do_failed_assertion

This fixes allmodconfig build.

Reported-by: Inochi Amaoto <inochiama@gmail.com>
Fixes: f2fab612824f ("riscv: Add kprobes KUnit test")
Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
Tested-by: Inochi Amaoto <inochiama@gmail.com>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/r/20251020-riscv-kunit-kconfig-fix-6-18-v1-2-d773b5d5ce48@iscas.ac.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/kernel/tests/Kconfig.debug
arch/riscv/kernel/tests/kprobes/Makefile
arch/riscv/kernel/tests/kprobes/test-kprobes.c

index 5db4df44279e9de4ae4006fa2e3349225ce1a477..40f8dafffa0ab63b87ab6c467578d35be76aee95 100644 (file)
@@ -31,7 +31,7 @@ config RISCV_MODULE_LINKING_KUNIT
          If unsure, say N.
 
 config RISCV_KPROBES_KUNIT
-       bool "KUnit test for riscv kprobes" if !KUNIT_ALL_TESTS
+       tristate "KUnit test for riscv kprobes" if !KUNIT_ALL_TESTS
        depends on KUNIT
        depends on KPROBES
        default KUNIT_ALL_TESTS
index 4cb6c66a98e8eaa93e472a546725da543410161c..df7256f62313e28370508cff88bfe9f52aad0e32 100644 (file)
@@ -1 +1,3 @@
-obj-y += test-kprobes.o test-kprobes-asm.o
+obj-$(CONFIG_RISCV_KPROBES_KUNIT) += kprobes_riscv_kunit.o
+
+kprobes_riscv_kunit-objs := test-kprobes.o test-kprobes-asm.o
index 0716c88bcec786ffd32744429aca72113c7f2fbc..664535ca0a98a066548e87341e1920bdf2d1484a 100644 (file)
@@ -54,3 +54,6 @@ static struct kunit_suite kprobes_test_suite = {
 };
 
 kunit_test_suites(&kprobes_test_suite);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("KUnit test for riscv kprobes");