Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH] selftests: x86: test_shadow_stack: return KSFT_SKIP when test is skipped
@ 2026-03-01  1:47 Aleksei Oladko
  2026-03-15 19:08 ` Aleksei Oladko
  2026-03-19 16:38 ` Pavel Tikhomirov
  0 siblings, 2 replies; 6+ messages in thread
From: Aleksei Oladko @ 2026-03-01  1:47 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	Shuah Khan, H . Peter Anvin
  Cc: linux-kselftest, linux-kernel, Aleksei Oladko

test_shadow_stack prints a message indicating that the test is
skipped in some cases, but still returns 1. This causes the test
to be reported as failed instead of skipped.

Return KSFT_SKIP in the skip path so the result is reported
correctly.

Signed-off-by: Aleksei Oladko <aleksey.oladko@virtuozzo.com>
---
 tools/testing/selftests/x86/test_shadow_stack.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/x86/test_shadow_stack.c b/tools/testing/selftests/x86/test_shadow_stack.c
index 21af54d5f4ea..1747ea4cb725 100644
--- a/tools/testing/selftests/x86/test_shadow_stack.c
+++ b/tools/testing/selftests/x86/test_shadow_stack.c
@@ -35,6 +35,7 @@
 #include <sys/signal.h>
 #include <linux/elf.h>
 #include <linux/perf_event.h>
+#include "kselftest.h"
 
 /*
  * Define the ABI defines if needed, so people can run the tests
@@ -981,7 +982,7 @@ int main(int argc, char *argv[])
 
 	if (ARCH_PRCTL(ARCH_SHSTK_ENABLE, ARCH_SHSTK_SHSTK)) {
 		printf("[SKIP]\tCould not enable Shadow stack\n");
-		return 1;
+		return KSFT_SKIP;
 	}
 
 	if (ARCH_PRCTL(ARCH_SHSTK_DISABLE, ARCH_SHSTK_SHSTK)) {
@@ -991,12 +992,12 @@ int main(int argc, char *argv[])
 
 	if (ARCH_PRCTL(ARCH_SHSTK_ENABLE, ARCH_SHSTK_SHSTK)) {
 		printf("[SKIP]\tCould not re-enable Shadow stack\n");
-		return 1;
+		return KSFT_SKIP;
 	}
 
 	if (ARCH_PRCTL(ARCH_SHSTK_ENABLE, ARCH_SHSTK_WRSS)) {
 		printf("[SKIP]\tCould not enable WRSS\n");
-		ret = 1;
+		ret = KSFT_SKIP;
 		goto out;
 	}
 
-- 
2.43.0


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

end of thread, other threads:[~2026-03-20 17:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-01  1:47 [PATCH] selftests: x86: test_shadow_stack: return KSFT_SKIP when test is skipped Aleksei Oladko
2026-03-15 19:08 ` Aleksei Oladko
2026-03-19 16:38 ` Pavel Tikhomirov
2026-03-19 17:42   ` Edgecombe, Rick P
2026-03-20  9:52     ` Pavel Tikhomirov
2026-03-20 17:23       ` Edgecombe, Rick P

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