[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c01d8c7e-bac7-4d4d-872d-14f0ac0c6ec2@collabora.com>
Date: Fri, 2 May 2025 18:42:55 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
Andy Lutomirski <luto@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
Vincenzo Frascino <vincenzo.frascino@....com>, Shuah Khan
<shuah@...nel.org>, "Jason A. Donenfeld" <Jason@...c4.com>
Cc: usama.anjum@...labora.com, Shuah Khan <skhan@...uxfoundation.org>,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH 1/7] selftests: vDSO: chacha: Correctly skip test if
necessary
On 5/2/25 5:40 PM, Thomas Weißschuh wrote:
> According to kselftest.h ksft_exit_skip() is not meant to be called when
> a plan has already been printed.
Agreed
>
> Use the recommended function ksft_test_result_skip().
>
> This fixes a bug, where the TAP output would be invalid when skipping:
>
> TAP version 13
> 1..1
> ok 2 # SKIP Not implemented on architecture
>
> The SKIP line should start with "ok 1" as the plan only contains one test.
>
> Fixes: 3b5992eaf730 ("selftests: vDSO: unconditionally build chacha test")
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
>
> ---
> I'm not sure if this is not a general bug in ksft_exit_skip().
> First ksft_xskip is incremented then read back through ksft_test_num() and
> then that result is incremented again.
>
> In any case, using the correct function is better.
> ---
> tools/testing/selftests/vDSO/vdso_test_chacha.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/vDSO/vdso_test_chacha.c b/tools/testing/selftests/vDSO/vdso_test_chacha.c
> index 8757f738b0b1a76a48c83c5e5df79925a30c1bc7..0aad682b12c8836efabb49a65a47cf87466891a3 100644
> --- a/tools/testing/selftests/vDSO/vdso_test_chacha.c
> +++ b/tools/testing/selftests/vDSO/vdso_test_chacha.c
> @@ -76,7 +76,8 @@ static void reference_chacha20_blocks(uint8_t *dst_bytes, const uint32_t *key, u
>
> void __weak __arch_chacha20_blocks_nostack(uint8_t *dst_bytes, const uint32_t *key, uint32_t *counter, size_t nblocks)
> {
> - ksft_exit_skip("Not implemented on architecture\n");
> + ksft_test_result_skip("Not implemented on architecture\n");
> + ksft_finished();
> }
>
> int main(int argc, char *argv[])
>
--
Regards,
Usama
Powered by blists - more mailing lists