Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Aleksei Oladko <aleksey.oladko@virtuozzo.com>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, Shuah Khan <shuah@kernel.org>,
	"H . Peter Anvin" <hpa@zytor.com>
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests: x86: test_shadow_stack: return KSFT_SKIP when test is skipped
Date: Sun, 15 Mar 2026 20:08:48 +0100	[thread overview]
Message-ID: <29501b9f-4c69-4687-823d-8df6b13bfb76@virtuozzo.com> (raw)
In-Reply-To: <20260301014733.454260-1-aleksey.oladko@virtuozzo.com>

Hi,

I just wanted to gently follow up to see if you had a chance to review 
this patch. Please let me know if there is anything I can clarify or 
improve.

Thanks!

On 3/1/26 2:47 AM, Aleksei Oladko wrote:
> 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;
>   	}
>   

  reply	other threads:[~2026-03-15 19:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29501b9f-4c69-4687-823d-8df6b13bfb76@virtuozzo.com \
    --to=aleksey.oladko@virtuozzo.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=shuah@kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox