[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c3a23032-5e25-429b-b096-e9bc0a72d026@app.fastmail.com>
Date: Fri, 14 Nov 2025 09:01:13 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
"Andy Lutomirski" <luto@...nel.org>, "Thomas Gleixner" <tglx@...utronix.de>,
"Vincenzo Frascino" <vincenzo.frascino@....com>, shuah <shuah@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v2 12/14] selftests: vDSO: vdso_test_correctness: Use system call
wrappers from vdso_syscalls.h
On Thu, Nov 13, 2025, at 16:30, Thomas Weißschuh wrote:
>
> static void test_one_clock_gettime(int clock, const char *name)
> {
> + struct __kernel_timespec start, end;
> struct __kernel_old_timespec vdso;
> - struct timespec start, end;
> int vdso_ret, end_ret;
>
> printf("[RUN]\tTesting clock_gettime for clock %s (%d)...\n", name,
This looks confusing to me: I can see that the existing code is
wrong because it passes a (libc-defined) timespec into the
sys_clock_gettime() that expects __kernel_old_timespec.
It looks like you are changing a sometimes-wrong type into
a consistently wrong type, but then you also change the
sys_clock_gettime() definition to return __kernel_timespec
instead of __kernel_old_timespec, so it ends up working.
Why not always use __kernel_old_timespec for the local variables
and the sys_clock_gettime() calls here?
> @@ -305,7 +291,7 @@ static void test_one_clock_gettime64(int clock, const char *name)
>
> printf("[RUN]\tTesting clock_gettime64 for clock %s (%d)...\n", name, clock);
>
> - if (sys_clock_gettime64(clock, &start) < 0) {
> + if (sys_clock_gettime(clock, &start) < 0) {
> if (errno == EINVAL) {
> vdso_ret = VDSO_CALL(vdso_clock_gettime64, 2, clock, &vdso);
> if (vdso_ret == -EINVAL) {
This looks like the correct fix to me. We were already uses the same
types for syscall and vdso paths, and now the types match the interface.
Arnd
Powered by blists - more mailing lists