public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate
@ 2025-10-20 12:23 Vivian Wang
  2025-10-20 12:23 ` [PATCH 1/2] riscv: tests: Rename kprobes_test_riscv to kprobes_riscv Vivian Wang
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Vivian Wang @ 2025-10-20 12:23 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Nam Cao
  Cc: linux-riscv, linux-kernel, Han Gao, Icenowy Zheng, Inochi Amaoto,
	Yao Zi, Vivian Wang

Fix an allmodconfig warning on v6.18-rc1:

    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

While we're at it, rename the test to remove the word "test", in order
to conform to the style guide.

---
Vivian Wang (2):
      riscv: tests: Rename kprobes_test_riscv to kprobes_riscv
      riscv: tests: Make RISCV_KPROBES_KUNIT tristate

 arch/riscv/kernel/tests/Kconfig.debug          | 2 +-
 arch/riscv/kernel/tests/kprobes/Makefile       | 4 +++-
 arch/riscv/kernel/tests/kprobes/test-kprobes.c | 5 ++++-
 3 files changed, 8 insertions(+), 3 deletions(-)
---
base-commit: cb6649f6217c0331b885cf787f1d175963e2a1d2
change-id: 20251020-riscv-kunit-kconfig-fix-6-18-01fc6eba6613

Best regards,
-- 
Vivian "dramforever" Wang


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] riscv: tests: Rename kprobes_test_riscv to kprobes_riscv
  2025-10-20 12:23 [PATCH 0/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate Vivian Wang
@ 2025-10-20 12:23 ` Vivian Wang
  2025-10-20 12:23 ` [PATCH 2/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate Vivian Wang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Vivian Wang @ 2025-10-20 12:23 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Nam Cao
  Cc: linux-riscv, linux-kernel, Han Gao, Icenowy Zheng, Inochi Amaoto,
	Yao Zi, Vivian Wang

According to Documentation/dev-tools/kunit/style.rst a KUnit test suite
normally should not have "test" in the name. Rename it to follow the
style guide.

Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>
---
 arch/riscv/kernel/tests/kprobes/test-kprobes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/tests/kprobes/test-kprobes.c b/arch/riscv/kernel/tests/kprobes/test-kprobes.c
index 6f6cdfbf5a95..0716c88bcec7 100644
--- a/arch/riscv/kernel/tests/kprobes/test-kprobes.c
+++ b/arch/riscv/kernel/tests/kprobes/test-kprobes.c
@@ -49,7 +49,7 @@ static struct kunit_case kprobes_testcases[] = {
 };
 
 static struct kunit_suite kprobes_test_suite = {
-	.name = "kprobes_test_riscv",
+	.name = "kprobes_riscv",
 	.test_cases = kprobes_testcases,
 };
 

-- 
2.51.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate
  2025-10-20 12:23 [PATCH 0/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate Vivian Wang
  2025-10-20 12:23 ` [PATCH 1/2] riscv: tests: Rename kprobes_test_riscv to kprobes_riscv Vivian Wang
@ 2025-10-20 12:23 ` Vivian Wang
  2025-10-20 12:59 ` [PATCH 0/2] " Vivian Wang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Vivian Wang @ 2025-10-20 12:23 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Nam Cao
  Cc: linux-riscv, linux-kernel, Han Gao, Icenowy Zheng, Inochi Amaoto,
	Yao Zi, Vivian Wang

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>
---
 arch/riscv/kernel/tests/Kconfig.debug          | 2 +-
 arch/riscv/kernel/tests/kprobes/Makefile       | 4 +++-
 arch/riscv/kernel/tests/kprobes/test-kprobes.c | 3 +++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/kernel/tests/Kconfig.debug b/arch/riscv/kernel/tests/Kconfig.debug
index 5db4df44279e..40f8dafffa0a 100644
--- a/arch/riscv/kernel/tests/Kconfig.debug
+++ b/arch/riscv/kernel/tests/Kconfig.debug
@@ -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
diff --git a/arch/riscv/kernel/tests/kprobes/Makefile b/arch/riscv/kernel/tests/kprobes/Makefile
index 4cb6c66a98e8..df7256f62313 100644
--- a/arch/riscv/kernel/tests/kprobes/Makefile
+++ b/arch/riscv/kernel/tests/kprobes/Makefile
@@ -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
diff --git a/arch/riscv/kernel/tests/kprobes/test-kprobes.c b/arch/riscv/kernel/tests/kprobes/test-kprobes.c
index 0716c88bcec7..664535ca0a98 100644
--- a/arch/riscv/kernel/tests/kprobes/test-kprobes.c
+++ b/arch/riscv/kernel/tests/kprobes/test-kprobes.c
@@ -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");

-- 
2.51.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate
  2025-10-20 12:23 [PATCH 0/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate Vivian Wang
  2025-10-20 12:23 ` [PATCH 1/2] riscv: tests: Rename kprobes_test_riscv to kprobes_riscv Vivian Wang
  2025-10-20 12:23 ` [PATCH 2/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate Vivian Wang
@ 2025-10-20 12:59 ` Vivian Wang
  2025-10-21 10:36 ` Nam Cao
  2025-10-22  0:47 ` Inochi Amaoto
  4 siblings, 0 replies; 6+ messages in thread
From: Vivian Wang @ 2025-10-20 12:59 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Nam Cao
  Cc: linux-riscv, linux-kernel, Han Gao, Icenowy Zheng, Inochi Amaoto,
	Yao Zi

On 10/20/25 20:23, Vivian Wang wrote:

> Fix an allmodconfig warning on v6.18-rc1:
>
>     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

For more context, I said this was to fix a warning, but I tried it out
anyway just to see what happens. Apparently, nothing. The kprobe tests
just don't run if RISCV_KPROBES_KUNIT=y but KUNIT=m.

So this config combination being just wrong is the problem, and the
warning is just a loud symptom.

Vivian "dramforever" Wang


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate
  2025-10-20 12:23 [PATCH 0/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate Vivian Wang
                   ` (2 preceding siblings ...)
  2025-10-20 12:59 ` [PATCH 0/2] " Vivian Wang
@ 2025-10-21 10:36 ` Nam Cao
  2025-10-22  0:47 ` Inochi Amaoto
  4 siblings, 0 replies; 6+ messages in thread
From: Nam Cao @ 2025-10-21 10:36 UTC (permalink / raw)
  To: Vivian Wang, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti
  Cc: linux-riscv, linux-kernel, Han Gao, Icenowy Zheng, Inochi Amaoto,
	Yao Zi, Vivian Wang

Vivian Wang <wangruikang@iscas.ac.cn> writes:
> Fix an allmodconfig warning on v6.18-rc1:
>
>     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
>
> While we're at it, rename the test to remove the word "test", in order
> to conform to the style guide.

Reviewed-by: Nam Cao <namcao@linutronix.de>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate
  2025-10-20 12:23 [PATCH 0/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate Vivian Wang
                   ` (3 preceding siblings ...)
  2025-10-21 10:36 ` Nam Cao
@ 2025-10-22  0:47 ` Inochi Amaoto
  4 siblings, 0 replies; 6+ messages in thread
From: Inochi Amaoto @ 2025-10-22  0:47 UTC (permalink / raw)
  To: Vivian Wang, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Nam Cao
  Cc: linux-riscv, linux-kernel, Han Gao, Icenowy Zheng, Inochi Amaoto,
	Yao Zi

On Mon, Oct 20, 2025 at 08:23:54PM +0800, Vivian Wang wrote:
> Fix an allmodconfig warning on v6.18-rc1:
> 
>     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
> 
> While we're at it, rename the test to remove the word "test", in order
> to conform to the style guide.
> 
> ---
> Vivian Wang (2):
>       riscv: tests: Rename kprobes_test_riscv to kprobes_riscv
>       riscv: tests: Make RISCV_KPROBES_KUNIT tristate
> 
>  arch/riscv/kernel/tests/Kconfig.debug          | 2 +-
>  arch/riscv/kernel/tests/kprobes/Makefile       | 4 +++-
>  arch/riscv/kernel/tests/kprobes/test-kprobes.c | 5 ++++-
>  3 files changed, 8 insertions(+), 3 deletions(-)
> ---
> base-commit: cb6649f6217c0331b885cf787f1d175963e2a1d2
> change-id: 20251020-riscv-kunit-kconfig-fix-6-18-01fc6eba6613
> 
> Best regards,
> -- 
> Vivian "dramforever" Wang
> 

Tested with allmodconfig

Tested-by: Inochi Amaoto <inochiama@gmail.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-10-22  0:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-20 12:23 [PATCH 0/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate Vivian Wang
2025-10-20 12:23 ` [PATCH 1/2] riscv: tests: Rename kprobes_test_riscv to kprobes_riscv Vivian Wang
2025-10-20 12:23 ` [PATCH 2/2] riscv: tests: Make RISCV_KPROBES_KUNIT tristate Vivian Wang
2025-10-20 12:59 ` [PATCH 0/2] " Vivian Wang
2025-10-21 10:36 ` Nam Cao
2025-10-22  0:47 ` Inochi Amaoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox