Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Andy Lutomirski" <luto@kernel.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Vincenzo Frascino" <vincenzo.frascino@arm.com>,
	shuah <shuah@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 04/10] selftests: vDSO: vdso_test_abi: Provide compatibility with 32-bit musl
Date: Tue, 11 Nov 2025 13:59:02 +0100	[thread overview]
Message-ID: <29dd9e11-9ae8-415a-acb3-b96af56550b0@app.fastmail.com> (raw)
In-Reply-To: <20251111-vdso-test-types-v1-4-03b31f88c659@linutronix.de>

On Tue, Nov 11, 2025, at 11:49, Thomas Weißschuh wrote:
> The 32-bit time variants on musl have different names, provide a fallback.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
>  tools/testing/selftests/vDSO/vdso_test_abi.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c 
> b/tools/testing/selftests/vDSO/vdso_test_abi.c
> index 
> bb5a5534ae7e8a46d7e68a561684c29a752b866d..0a6b16a21369642384d43b0efd1bca227a2a4298 
> 100644
> --- a/tools/testing/selftests/vDSO/vdso_test_abi.c
> +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c
> @@ -166,7 +166,11 @@ static void 
> vdso_test_clock_getres(__kernel_clockid_t clk_id)
>  		clock_getres_fail++;
>  	}
> 
> +#ifdef SYS_clock_getres
>  	ret = syscall(SYS_clock_getres, clk_id, &sys_ts);
> +#else
> +	ret = syscall(SYS_clock_getres_time32, clk_id, &sys_ts);
> +#endif
> 

I think this #ifdef check is not reliable enough and may hide
bugs. As with the other syscalls, the best way to call these
is to either use __NR_clock_getres_time64 on __kernel_timespec, or
to use __NR_clock_getres on __kernel_old_timespec.

If we are trying to validate the interface here, we should probably
call both if available. If we just want to know the result and
trust that both work correctly, I'd always use __NR_clock_getres_time64
on 32-bit systems and __NR_clock_getres on 64-bit systems.

      Arnd

  reply	other threads:[~2025-11-11 12:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11 10:49 [PATCH 00/10] selftests: vDSO: Stop using libc types for vDSO calls Thomas Weißschuh
2025-11-11 10:49 ` [PATCH 01/10] Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers" Thomas Weißschuh
2025-11-11 10:49 ` [PATCH 02/10] selftests: vDSO: Introduce vdso_types.h Thomas Weißschuh
2025-11-11 12:45   ` Arnd Bergmann
2025-11-11 13:47     ` Thomas Weißschuh
2025-11-11 14:48       ` Thomas Weißschuh
2025-11-11 10:49 ` [PATCH 03/10] selftests: vDSO: vdso_test_abi: Use types from vdso_types.h Thomas Weißschuh
2025-11-11 10:49 ` [PATCH 04/10] selftests: vDSO: vdso_test_abi: Provide compatibility with 32-bit musl Thomas Weißschuh
2025-11-11 12:59   ` Arnd Bergmann [this message]
2025-11-11 13:55     ` Thomas Weißschuh
2025-11-11 14:19       ` Arnd Bergmann
2025-11-11 14:46         ` Thomas Weißschuh
2025-11-11 15:07           ` Arnd Bergmann
2025-11-11 15:50             ` Thomas Weißschuh
2025-11-11 16:28               ` Arnd Bergmann
2025-11-11 10:49 ` [PATCH 05/10] selftests: vDSO: vdso_test_gettimeofday: Remove nolibc checks Thomas Weißschuh
2025-11-11 10:49 ` [PATCH 06/10] selftests: vDSO: vdso_test_gettimeofday: Use types from vdso_types.h Thomas Weißschuh
2025-11-11 10:49 ` [PATCH 07/10] selftests: vDSO: vdso_test_correctness: Drop SYS_getcpu fallbacks Thomas Weißschuh
2025-11-11 10:49 ` [PATCH 08/10] selftests: vDSO: vdso_test_correctness: Use types from vdso_types.h Thomas Weißschuh
2025-11-11 10:49 ` [PATCH 09/10] selftests: vDSO: vdso_test_correctness: Provide compatibility with 32-bit musl Thomas Weißschuh
2025-11-11 10:49 ` [PATCH 10/10] selftests: vDSO: vdso_test_correctness: Use facilities from parse_vdso.c Thomas Weißschuh

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=29dd9e11-9ae8-415a-acb3-b96af56550b0@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=vincenzo.frascino@arm.com \
    /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