* [PATCH v2 1/6] Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers"
2026-02-27 6:45 [PATCH v2 0/6] selftests: vDSO: Assorted cleanups and improvements Thomas Weißschuh
@ 2026-02-27 6:45 ` Thomas Weißschuh
2026-03-11 9:31 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
2026-02-27 6:45 ` [PATCH v2 2/6] selftests: vDSO: vdso_test_gettimeofday: Remove nolibc checks Thomas Weißschuh
` (4 subsequent siblings)
5 siblings, 2 replies; 19+ messages in thread
From: Thomas Weißschuh @ 2026-02-27 6:45 UTC (permalink / raw)
To: Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino, Shuah Khan
Cc: linux-kernel, linux-kselftest, Thomas Weißschuh
This reverts commit c9fbaa879508 ("selftests: vDSO: parse_vdso: Use UAPI
headers instead of libc headers")
The kernel headers were used to make parse_vdso.c compatible with
nolibc. Unfortunately linux/elf.h is incompatible with glibc's
sys/auxv.h. When using glibc it is therefore not possible build
parse_vdso.c as part of the same compilation unit as its caller
as sys/auxv.h is needed for getauxval().
In the meantime nolibc gained its own elf.h, providing compatibility
with the documented libc interfaces.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
tools/testing/selftests/vDSO/Makefile | 2 --
tools/testing/selftests/vDSO/parse_vdso.c | 3 +--
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index e361aca22a74..2de5cef311c8 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -19,8 +19,6 @@ endif
include ../lib.mk
-CFLAGS += $(TOOLS_INCLUDES)
-
CFLAGS_NOLIBC := -nostdlib -nostdinc -ffreestanding -fno-asynchronous-unwind-tables \
-fno-stack-protector -include $(top_srcdir)/tools/include/nolibc/nolibc.h \
-I$(top_srcdir)/tools/include/nolibc/ $(KHDR_INCLUDES)
diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c
index 3ff00fb624a4..c6ff4413ea36 100644
--- a/tools/testing/selftests/vDSO/parse_vdso.c
+++ b/tools/testing/selftests/vDSO/parse_vdso.c
@@ -19,8 +19,7 @@
#include <stdint.h>
#include <string.h>
#include <limits.h>
-#include <linux/auxvec.h>
-#include <linux/elf.h>
+#include <elf.h>
#include "parse_vdso.h"
--
2.53.0
^ permalink raw reply [flat|nested] 19+ messages in thread* [tip: timers/vdso] Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers"
2026-02-27 6:45 ` [PATCH v2 1/6] Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers" Thomas Weißschuh
@ 2026-03-11 9:31 ` tip-bot2 for Thomas Weißschuh
2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
1 sibling, 0 replies; 19+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-03-11 9:31 UTC (permalink / raw)
To: linux-tip-commits; +Cc: thomas.weissschuh, Thomas Gleixner, x86, linux-kernel
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: 8919083b6a0bb76d43e44da4ab0f08f52456434a
Gitweb: https://git.kernel.org/tip/8919083b6a0bb76d43e44da4ab0f08f52456434a
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Fri, 27 Feb 2026 07:45:56 +01:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Wed, 11 Mar 2026 10:27:39 +01:00
Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers"
This reverts commit c9fbaa879508 ("selftests: vDSO: parse_vdso: Use UAPI
headers instead of libc headers")
The kernel headers were used to make parse_vdso.c compatible with
nolibc. Unfortunately linux/elf.h is incompatible with glibc's
sys/auxv.h. When using glibc it is therefore not possible build
parse_vdso.c as part of the same compilation unit as its caller
as sys/auxv.h is needed for getauxval().
In the meantime nolibc gained its own elf.h, providing compatibility
with the documented libc interfaces.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-1-d84830fa8beb@linutronix.de
---
tools/testing/selftests/vDSO/Makefile | 2 --
tools/testing/selftests/vDSO/parse_vdso.c | 3 +--
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index e361aca..2de5cef 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -19,8 +19,6 @@ endif
include ../lib.mk
-CFLAGS += $(TOOLS_INCLUDES)
-
CFLAGS_NOLIBC := -nostdlib -nostdinc -ffreestanding -fno-asynchronous-unwind-tables \
-fno-stack-protector -include $(top_srcdir)/tools/include/nolibc/nolibc.h \
-I$(top_srcdir)/tools/include/nolibc/ $(KHDR_INCLUDES)
diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c
index 3ff00fb..c6ff441 100644
--- a/tools/testing/selftests/vDSO/parse_vdso.c
+++ b/tools/testing/selftests/vDSO/parse_vdso.c
@@ -19,8 +19,7 @@
#include <stdint.h>
#include <string.h>
#include <limits.h>
-#include <linux/auxvec.h>
-#include <linux/elf.h>
+#include <elf.h>
#include "parse_vdso.h"
^ permalink raw reply [flat|nested] 19+ messages in thread* [tip: timers/vdso] Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers"
2026-02-27 6:45 ` [PATCH v2 1/6] Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers" Thomas Weißschuh
2026-03-11 9:31 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
@ 2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
1 sibling, 0 replies; 19+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-03-11 14:51 UTC (permalink / raw)
To: linux-tip-commits
Cc: thomas.weissschuh, Thomas Gleixner, Borislav Petkov (AMD),
x86, linux-kernel
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: 5abfa0c4da3bdcc53597127be7cd4054812b0383
Gitweb: https://git.kernel.org/tip/5abfa0c4da3bdcc53597127be7cd4054812b0383
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Fri, 27 Feb 2026 07:45:56 +01:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Wed, 11 Mar 2026 15:22:55 +01:00
Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers"
This reverts commit c9fbaa879508 ("selftests: vDSO: parse_vdso: Use UAPI
headers instead of libc headers")
The kernel headers were used to make parse_vdso.c compatible with
nolibc. Unfortunately linux/elf.h is incompatible with glibc's
sys/auxv.h. When using glibc it is therefore not possible build
parse_vdso.c as part of the same compilation unit as its caller
as sys/auxv.h is needed for getauxval().
In the meantime nolibc gained its own elf.h, providing compatibility
with the documented libc interfaces.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-1-d84830fa8beb@linutronix.de
---
tools/testing/selftests/vDSO/Makefile | 2 --
tools/testing/selftests/vDSO/parse_vdso.c | 3 +--
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index e361aca..2de5cef 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -19,8 +19,6 @@ endif
include ../lib.mk
-CFLAGS += $(TOOLS_INCLUDES)
-
CFLAGS_NOLIBC := -nostdlib -nostdinc -ffreestanding -fno-asynchronous-unwind-tables \
-fno-stack-protector -include $(top_srcdir)/tools/include/nolibc/nolibc.h \
-I$(top_srcdir)/tools/include/nolibc/ $(KHDR_INCLUDES)
diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c
index 3ff00fb..c6ff441 100644
--- a/tools/testing/selftests/vDSO/parse_vdso.c
+++ b/tools/testing/selftests/vDSO/parse_vdso.c
@@ -19,8 +19,7 @@
#include <stdint.h>
#include <string.h>
#include <limits.h>
-#include <linux/auxvec.h>
-#include <linux/elf.h>
+#include <elf.h>
#include "parse_vdso.h"
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 2/6] selftests: vDSO: vdso_test_gettimeofday: Remove nolibc checks
2026-02-27 6:45 [PATCH v2 0/6] selftests: vDSO: Assorted cleanups and improvements Thomas Weißschuh
2026-02-27 6:45 ` [PATCH v2 1/6] Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers" Thomas Weißschuh
@ 2026-02-27 6:45 ` Thomas Weißschuh
2026-03-11 9:31 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
2026-02-27 6:45 ` [PATCH v2 3/6] selftests: vDSO: vdso_test_correctness: Drop SYS_getcpu fallbacks Thomas Weißschuh
` (3 subsequent siblings)
5 siblings, 2 replies; 19+ messages in thread
From: Thomas Weißschuh @ 2026-02-27 6:45 UTC (permalink / raw)
To: Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino, Shuah Khan
Cc: linux-kernel, linux-kselftest, Thomas Weißschuh
nolibc now provides these headers, making the check unnecessary.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
index 912edadad92c..990b29e0e272 100644
--- a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
+++ b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
@@ -11,10 +11,8 @@
*/
#include <stdio.h>
-#ifndef NOLIBC
#include <sys/auxv.h>
#include <sys/time.h>
-#endif
#include "kselftest.h"
#include "parse_vdso.h"
--
2.53.0
^ permalink raw reply [flat|nested] 19+ messages in thread* [tip: timers/vdso] selftests: vDSO: vdso_test_gettimeofday: Remove nolibc checks
2026-02-27 6:45 ` [PATCH v2 2/6] selftests: vDSO: vdso_test_gettimeofday: Remove nolibc checks Thomas Weißschuh
@ 2026-03-11 9:31 ` tip-bot2 for Thomas Weißschuh
2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
1 sibling, 0 replies; 19+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-03-11 9:31 UTC (permalink / raw)
To: linux-tip-commits; +Cc: thomas.weissschuh, Thomas Gleixner, x86, linux-kernel
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: 1f3ecd18a3465b318d3014a59c08c21dc136515e
Gitweb: https://git.kernel.org/tip/1f3ecd18a3465b318d3014a59c08c21dc136515e
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Fri, 27 Feb 2026 07:45:57 +01:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Wed, 11 Mar 2026 10:27:39 +01:00
selftests: vDSO: vdso_test_gettimeofday: Remove nolibc checks
nolibc now provides these headers, making the check unnecessary.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-2-d84830fa8beb@linutronix.de
---
tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
index 912edad..990b29e 100644
--- a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
+++ b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
@@ -11,10 +11,8 @@
*/
#include <stdio.h>
-#ifndef NOLIBC
#include <sys/auxv.h>
#include <sys/time.h>
-#endif
#include "kselftest.h"
#include "parse_vdso.h"
^ permalink raw reply [flat|nested] 19+ messages in thread
* [tip: timers/vdso] selftests: vDSO: vdso_test_gettimeofday: Remove nolibc checks
2026-02-27 6:45 ` [PATCH v2 2/6] selftests: vDSO: vdso_test_gettimeofday: Remove nolibc checks Thomas Weißschuh
2026-03-11 9:31 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
@ 2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
1 sibling, 0 replies; 19+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-03-11 14:51 UTC (permalink / raw)
To: linux-tip-commits
Cc: thomas.weissschuh, Thomas Gleixner, Borislav Petkov (AMD),
x86, linux-kernel
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: 50692c25ee2e8f9093ec3409ee43b342d9d07775
Gitweb: https://git.kernel.org/tip/50692c25ee2e8f9093ec3409ee43b342d9d07775
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Fri, 27 Feb 2026 07:45:57 +01:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Wed, 11 Mar 2026 15:23:01 +01:00
selftests: vDSO: vdso_test_gettimeofday: Remove nolibc checks
nolibc now provides these headers, making the check unnecessary.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-2-d84830fa8beb@linutronix.de
---
tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
index 912edad..990b29e 100644
--- a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
+++ b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c
@@ -11,10 +11,8 @@
*/
#include <stdio.h>
-#ifndef NOLIBC
#include <sys/auxv.h>
#include <sys/time.h>
-#endif
#include "kselftest.h"
#include "parse_vdso.h"
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 3/6] selftests: vDSO: vdso_test_correctness: Drop SYS_getcpu fallbacks
2026-02-27 6:45 [PATCH v2 0/6] selftests: vDSO: Assorted cleanups and improvements Thomas Weißschuh
2026-02-27 6:45 ` [PATCH v2 1/6] Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers" Thomas Weißschuh
2026-02-27 6:45 ` [PATCH v2 2/6] selftests: vDSO: vdso_test_gettimeofday: Remove nolibc checks Thomas Weißschuh
@ 2026-02-27 6:45 ` Thomas Weißschuh
2026-03-11 9:31 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
2026-02-27 6:45 ` [PATCH v2 4/6] selftests: vDSO: vdso_test_correctness: Handle different tv_usec types Thomas Weißschuh
` (2 subsequent siblings)
5 siblings, 2 replies; 19+ messages in thread
From: Thomas Weißschuh @ 2026-02-27 6:45 UTC (permalink / raw)
To: Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino, Shuah Khan
Cc: linux-kernel, linux-kselftest, Thomas Weißschuh
These fallbacks are only valid on x86 and unused in the first place.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
tools/testing/selftests/vDSO/vdso_test_correctness.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index 055af95aa552..2a2d9b01a938 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -25,14 +25,6 @@
static const char **name;
-#ifndef SYS_getcpu
-# ifdef __x86_64__
-# define SYS_getcpu 309
-# else
-# define SYS_getcpu 318
-# endif
-#endif
-
#ifndef __NR_clock_gettime64
#define __NR_clock_gettime64 403
#endif
--
2.53.0
^ permalink raw reply [flat|nested] 19+ messages in thread* [tip: timers/vdso] selftests: vDSO: vdso_test_correctness: Drop SYS_getcpu fallbacks
2026-02-27 6:45 ` [PATCH v2 3/6] selftests: vDSO: vdso_test_correctness: Drop SYS_getcpu fallbacks Thomas Weißschuh
@ 2026-03-11 9:31 ` tip-bot2 for Thomas Weißschuh
2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
1 sibling, 0 replies; 19+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-03-11 9:31 UTC (permalink / raw)
To: linux-tip-commits; +Cc: thomas.weissschuh, Thomas Gleixner, x86, linux-kernel
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: a992030b21814515129797e55147d822870e0cdb
Gitweb: https://git.kernel.org/tip/a992030b21814515129797e55147d822870e0cdb
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Fri, 27 Feb 2026 07:45:58 +01:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Wed, 11 Mar 2026 10:27:40 +01:00
selftests: vDSO: vdso_test_correctness: Drop SYS_getcpu fallbacks
These fallbacks are only valid on x86 and unused in the first place.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-3-d84830fa8beb@linutronix.de
---
tools/testing/selftests/vDSO/vdso_test_correctness.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index 055af95..2a2d9b0 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -25,14 +25,6 @@
static const char **name;
-#ifndef SYS_getcpu
-# ifdef __x86_64__
-# define SYS_getcpu 309
-# else
-# define SYS_getcpu 318
-# endif
-#endif
-
#ifndef __NR_clock_gettime64
#define __NR_clock_gettime64 403
#endif
^ permalink raw reply [flat|nested] 19+ messages in thread
* [tip: timers/vdso] selftests: vDSO: vdso_test_correctness: Drop SYS_getcpu fallbacks
2026-02-27 6:45 ` [PATCH v2 3/6] selftests: vDSO: vdso_test_correctness: Drop SYS_getcpu fallbacks Thomas Weißschuh
2026-03-11 9:31 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
@ 2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
1 sibling, 0 replies; 19+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-03-11 14:51 UTC (permalink / raw)
To: linux-tip-commits
Cc: thomas.weissschuh, Thomas Gleixner, Borislav Petkov (AMD),
x86, linux-kernel
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: ad2af7768fac884ede727d2a085bd78b8e13fdef
Gitweb: https://git.kernel.org/tip/ad2af7768fac884ede727d2a085bd78b8e13fdef
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Fri, 27 Feb 2026 07:45:58 +01:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Wed, 11 Mar 2026 15:23:06 +01:00
selftests: vDSO: vdso_test_correctness: Drop SYS_getcpu fallbacks
These fallbacks are only valid on x86 and unused in the first place.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-3-d84830fa8beb@linutronix.de
---
tools/testing/selftests/vDSO/vdso_test_correctness.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index 055af95..2a2d9b0 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -25,14 +25,6 @@
static const char **name;
-#ifndef SYS_getcpu
-# ifdef __x86_64__
-# define SYS_getcpu 309
-# else
-# define SYS_getcpu 318
-# endif
-#endif
-
#ifndef __NR_clock_gettime64
#define __NR_clock_gettime64 403
#endif
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 4/6] selftests: vDSO: vdso_test_correctness: Handle different tv_usec types
2026-02-27 6:45 [PATCH v2 0/6] selftests: vDSO: Assorted cleanups and improvements Thomas Weißschuh
` (2 preceding siblings ...)
2026-02-27 6:45 ` [PATCH v2 3/6] selftests: vDSO: vdso_test_correctness: Drop SYS_getcpu fallbacks Thomas Weißschuh
@ 2026-02-27 6:45 ` Thomas Weißschuh
2026-03-11 9:31 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
2026-02-27 6:46 ` [PATCH v2 5/6] selftests: vDSO: vdso_test_correctness: Use facilities from parse_vdso.c Thomas Weißschuh
2026-02-27 6:46 ` [PATCH v2 6/6] selftests: vDSO: vdso_test_correctness: Add a test for time() Thomas Weißschuh
5 siblings, 2 replies; 19+ messages in thread
From: Thomas Weißschuh @ 2026-02-27 6:45 UTC (permalink / raw)
To: Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino, Shuah Khan
Cc: linux-kernel, linux-kselftest, Thomas Weißschuh, Andreas Larsson
On SPARC the field tv_usec of 'struct timespec' is not a 'long int', but
only a regular int. In this case the format string is incorrect and will
trigger compiler warnings.
Avoid the warnings by casting to 'long long', similar to how it is done for
the tv_sec and what the other similar selftests are doing.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Tested-by: Andreas Larsson <andreas@gaisler.com>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
---
tools/testing/selftests/vDSO/vdso_test_correctness.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index 2a2d9b01a938..9b564888e74d 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -404,10 +404,10 @@ static void test_gettimeofday(void)
return;
}
- printf("\t%llu.%06ld %llu.%06ld %llu.%06ld\n",
- (unsigned long long)start.tv_sec, start.tv_usec,
- (unsigned long long)vdso.tv_sec, vdso.tv_usec,
- (unsigned long long)end.tv_sec, end.tv_usec);
+ printf("\t%llu.%06lld %llu.%06lld %llu.%06lld\n",
+ (unsigned long long)start.tv_sec, (long long)start.tv_usec,
+ (unsigned long long)vdso.tv_sec, (long long)vdso.tv_usec,
+ (unsigned long long)end.tv_sec, (long long)end.tv_usec);
if (!tv_leq(&start, &vdso) || !tv_leq(&vdso, &end)) {
printf("[FAIL]\tTimes are out of sequence\n");
--
2.53.0
^ permalink raw reply [flat|nested] 19+ messages in thread* [tip: timers/vdso] selftests: vDSO: vdso_test_correctness: Handle different tv_usec types
2026-02-27 6:45 ` [PATCH v2 4/6] selftests: vDSO: vdso_test_correctness: Handle different tv_usec types Thomas Weißschuh
@ 2026-03-11 9:31 ` tip-bot2 for Thomas Weißschuh
2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
1 sibling, 0 replies; 19+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-03-11 9:31 UTC (permalink / raw)
To: linux-tip-commits
Cc: thomas.weissschuh, Thomas Gleixner, Andreas Larsson, x86, linux-kernel
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: b88e65e528dc5381131fc15761864470d723943c
Gitweb: https://git.kernel.org/tip/b88e65e528dc5381131fc15761864470d723943c
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Fri, 27 Feb 2026 07:45:59 +01:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Wed, 11 Mar 2026 10:27:40 +01:00
selftests: vDSO: vdso_test_correctness: Handle different tv_usec types
On SPARC the field tv_usec of 'struct timespec' is not a 'long int', but
only a regular int. In this case the format string is incorrect and will
trigger compiler warnings.
Avoid the warnings by casting to 'long long', similar to how it is done for
the tv_sec and what the other similar selftests are doing.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Andreas Larsson <andreas@gaisler.com>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-4-d84830fa8beb@linutronix.de
---
tools/testing/selftests/vDSO/vdso_test_correctness.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index 2a2d9b0..9b56488 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -404,10 +404,10 @@ static void test_gettimeofday(void)
return;
}
- printf("\t%llu.%06ld %llu.%06ld %llu.%06ld\n",
- (unsigned long long)start.tv_sec, start.tv_usec,
- (unsigned long long)vdso.tv_sec, vdso.tv_usec,
- (unsigned long long)end.tv_sec, end.tv_usec);
+ printf("\t%llu.%06lld %llu.%06lld %llu.%06lld\n",
+ (unsigned long long)start.tv_sec, (long long)start.tv_usec,
+ (unsigned long long)vdso.tv_sec, (long long)vdso.tv_usec,
+ (unsigned long long)end.tv_sec, (long long)end.tv_usec);
if (!tv_leq(&start, &vdso) || !tv_leq(&vdso, &end)) {
printf("[FAIL]\tTimes are out of sequence\n");
^ permalink raw reply [flat|nested] 19+ messages in thread* [tip: timers/vdso] selftests: vDSO: vdso_test_correctness: Handle different tv_usec types
2026-02-27 6:45 ` [PATCH v2 4/6] selftests: vDSO: vdso_test_correctness: Handle different tv_usec types Thomas Weißschuh
2026-03-11 9:31 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
@ 2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
1 sibling, 0 replies; 19+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-03-11 14:51 UTC (permalink / raw)
To: linux-tip-commits
Cc: thomas.weissschuh, Thomas Gleixner, Borislav Petkov (AMD),
Andreas Larsson, x86, linux-kernel
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: 38bc16aa47dc89dc3753ee5359c7a7c15f7bf602
Gitweb: https://git.kernel.org/tip/38bc16aa47dc89dc3753ee5359c7a7c15f7bf602
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Fri, 27 Feb 2026 07:45:59 +01:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Wed, 11 Mar 2026 15:23:11 +01:00
selftests: vDSO: vdso_test_correctness: Handle different tv_usec types
On SPARC the field tv_usec of 'struct timespec' is not a 'long int', but
only a regular int. In this case the format string is incorrect and will
trigger compiler warnings.
Avoid the warnings by casting to 'long long', similar to how it is done for
the tv_sec and what the other similar selftests are doing.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Andreas Larsson <andreas@gaisler.com>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-4-d84830fa8beb@linutronix.de
---
tools/testing/selftests/vDSO/vdso_test_correctness.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index 2a2d9b0..9b56488 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -404,10 +404,10 @@ static void test_gettimeofday(void)
return;
}
- printf("\t%llu.%06ld %llu.%06ld %llu.%06ld\n",
- (unsigned long long)start.tv_sec, start.tv_usec,
- (unsigned long long)vdso.tv_sec, vdso.tv_usec,
- (unsigned long long)end.tv_sec, end.tv_usec);
+ printf("\t%llu.%06lld %llu.%06lld %llu.%06lld\n",
+ (unsigned long long)start.tv_sec, (long long)start.tv_usec,
+ (unsigned long long)vdso.tv_sec, (long long)vdso.tv_usec,
+ (unsigned long long)end.tv_sec, (long long)end.tv_usec);
if (!tv_leq(&start, &vdso) || !tv_leq(&vdso, &end)) {
printf("[FAIL]\tTimes are out of sequence\n");
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 5/6] selftests: vDSO: vdso_test_correctness: Use facilities from parse_vdso.c
2026-02-27 6:45 [PATCH v2 0/6] selftests: vDSO: Assorted cleanups and improvements Thomas Weißschuh
` (3 preceding siblings ...)
2026-02-27 6:45 ` [PATCH v2 4/6] selftests: vDSO: vdso_test_correctness: Handle different tv_usec types Thomas Weißschuh
@ 2026-02-27 6:46 ` Thomas Weißschuh
2026-03-11 9:31 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
2026-02-27 6:46 ` [PATCH v2 6/6] selftests: vDSO: vdso_test_correctness: Add a test for time() Thomas Weißschuh
5 siblings, 2 replies; 19+ messages in thread
From: Thomas Weißschuh @ 2026-02-27 6:46 UTC (permalink / raw)
To: Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino, Shuah Khan
Cc: linux-kernel, linux-kselftest, Thomas Weißschuh
The soname from the vDSO is not a public API. Furthermore it requires
libc to implement dlsym() and friends.
Use the facilities from parse_vdso.c instead which uses the official
vDSO ABI to find it, aligned with the other vDSO selftests.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
tools/testing/selftests/vDSO/Makefile | 4 +--
.../testing/selftests/vDSO/vdso_test_correctness.c | 30 ++++++++++------------
2 files changed, 14 insertions(+), 20 deletions(-)
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index 2de5cef311c8..a61047bdcd57 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -26,13 +26,11 @@ CFLAGS_NOLIBC := -nostdlib -nostdinc -ffreestanding -fno-asynchronous-unwind-tab
$(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
$(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
$(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c
+$(OUTPUT)/vdso_test_correctness: parse_vdso.c vdso_test_correctness.c
$(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c | headers
$(OUTPUT)/vdso_standalone_test_x86: CFLAGS:=$(CFLAGS_NOLIBC) $(CFLAGS)
-$(OUTPUT)/vdso_test_correctness: vdso_test_correctness.c
-$(OUTPUT)/vdso_test_correctness: LDFLAGS += -ldl
-
$(OUTPUT)/vdso_test_getrandom: parse_vdso.c
$(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \
$(KHDR_INCLUDES) \
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index 9b564888e74d..a94ab4d597b1 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -11,18 +11,20 @@
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
+#include <sys/auxv.h>
#include <sys/syscall.h>
-#include <dlfcn.h>
#include <string.h>
#include <errno.h>
#include <sched.h>
#include <stdbool.h>
#include <limits.h>
+#include "parse_vdso.h"
#include "vdso_config.h"
#include "vdso_call.h"
#include "kselftest.h"
+static const char *version;
static const char **name;
#ifndef __NR_clock_gettime64
@@ -102,39 +104,32 @@ static void *vsyscall_getcpu(void)
static void fill_function_pointers(void)
{
- void *vdso = dlopen("linux-vdso.so.1",
- RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (!vdso)
- vdso = dlopen("linux-gate.so.1",
- RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (!vdso)
- vdso = dlopen("linux-vdso32.so.1",
- RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (!vdso)
- vdso = dlopen("linux-vdso64.so.1",
- RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (!vdso) {
+ unsigned long sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR);
+
+ if (!sysinfo_ehdr) {
printf("[WARN]\tfailed to find vDSO\n");
return;
}
- vdso_getcpu = (getcpu_t)dlsym(vdso, name[4]);
+ vdso_init_from_sysinfo_ehdr(sysinfo_ehdr);
+
+ vdso_getcpu = (getcpu_t)vdso_sym(version, name[4]);
if (!vdso_getcpu)
printf("Warning: failed to find getcpu in vDSO\n");
vgetcpu = (getcpu_t) vsyscall_getcpu();
- vdso_clock_gettime = (vgettime_t)dlsym(vdso, name[1]);
+ vdso_clock_gettime = (vgettime_t)vdso_sym(version, name[1]);
if (!vdso_clock_gettime)
printf("Warning: failed to find clock_gettime in vDSO\n");
#if defined(VDSO_32BIT)
- vdso_clock_gettime64 = (vgettime64_t)dlsym(vdso, name[5]);
+ vdso_clock_gettime64 = (vgettime64_t)vdso_sym(version, name[5]);
if (!vdso_clock_gettime64)
printf("Warning: failed to find clock_gettime64 in vDSO\n");
#endif
- vdso_gettimeofday = (vgtod_t)dlsym(vdso, name[0]);
+ vdso_gettimeofday = (vgtod_t)vdso_sym(version, name[0]);
if (!vdso_gettimeofday)
printf("Warning: failed to find gettimeofday in vDSO\n");
@@ -429,6 +424,7 @@ static void test_gettimeofday(void)
int main(int argc, char **argv)
{
+ version = versions[VDSO_VERSION];
name = (const char **)&names[VDSO_NAMES];
fill_function_pointers();
--
2.53.0
^ permalink raw reply [flat|nested] 19+ messages in thread* [tip: timers/vdso] selftests: vDSO: vdso_test_correctness: Use facilities from parse_vdso.c
2026-02-27 6:46 ` [PATCH v2 5/6] selftests: vDSO: vdso_test_correctness: Use facilities from parse_vdso.c Thomas Weißschuh
@ 2026-03-11 9:31 ` tip-bot2 for Thomas Weißschuh
2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
1 sibling, 0 replies; 19+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-03-11 9:31 UTC (permalink / raw)
To: linux-tip-commits; +Cc: thomas.weissschuh, Thomas Gleixner, x86, linux-kernel
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: 5a9acc2874cf0a1a733612c99d67229f3fa08fa6
Gitweb: https://git.kernel.org/tip/5a9acc2874cf0a1a733612c99d67229f3fa08fa6
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Fri, 27 Feb 2026 07:46:00 +01:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Wed, 11 Mar 2026 10:27:40 +01:00
selftests: vDSO: vdso_test_correctness: Use facilities from parse_vdso.c
The soname from the vDSO is not a public API. Furthermore it requires
libc to implement dlsym() and friends.
Use the facilities from parse_vdso.c instead which uses the official
vDSO ABI to find it, aligned with the other vDSO selftests.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-5-d84830fa8beb@linutronix.de
---
tools/testing/selftests/vDSO/Makefile | 4 +-
tools/testing/selftests/vDSO/vdso_test_correctness.c | 30 ++++-------
2 files changed, 14 insertions(+), 20 deletions(-)
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index 2de5cef..a61047b 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -26,13 +26,11 @@ CFLAGS_NOLIBC := -nostdlib -nostdinc -ffreestanding -fno-asynchronous-unwind-tab
$(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
$(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
$(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c
+$(OUTPUT)/vdso_test_correctness: parse_vdso.c vdso_test_correctness.c
$(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c | headers
$(OUTPUT)/vdso_standalone_test_x86: CFLAGS:=$(CFLAGS_NOLIBC) $(CFLAGS)
-$(OUTPUT)/vdso_test_correctness: vdso_test_correctness.c
-$(OUTPUT)/vdso_test_correctness: LDFLAGS += -ldl
-
$(OUTPUT)/vdso_test_getrandom: parse_vdso.c
$(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \
$(KHDR_INCLUDES) \
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index 9b56488..a94ab4d 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -11,18 +11,20 @@
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
+#include <sys/auxv.h>
#include <sys/syscall.h>
-#include <dlfcn.h>
#include <string.h>
#include <errno.h>
#include <sched.h>
#include <stdbool.h>
#include <limits.h>
+#include "parse_vdso.h"
#include "vdso_config.h"
#include "vdso_call.h"
#include "kselftest.h"
+static const char *version;
static const char **name;
#ifndef __NR_clock_gettime64
@@ -102,39 +104,32 @@ static void *vsyscall_getcpu(void)
static void fill_function_pointers(void)
{
- void *vdso = dlopen("linux-vdso.so.1",
- RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (!vdso)
- vdso = dlopen("linux-gate.so.1",
- RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (!vdso)
- vdso = dlopen("linux-vdso32.so.1",
- RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (!vdso)
- vdso = dlopen("linux-vdso64.so.1",
- RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (!vdso) {
+ unsigned long sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR);
+
+ if (!sysinfo_ehdr) {
printf("[WARN]\tfailed to find vDSO\n");
return;
}
- vdso_getcpu = (getcpu_t)dlsym(vdso, name[4]);
+ vdso_init_from_sysinfo_ehdr(sysinfo_ehdr);
+
+ vdso_getcpu = (getcpu_t)vdso_sym(version, name[4]);
if (!vdso_getcpu)
printf("Warning: failed to find getcpu in vDSO\n");
vgetcpu = (getcpu_t) vsyscall_getcpu();
- vdso_clock_gettime = (vgettime_t)dlsym(vdso, name[1]);
+ vdso_clock_gettime = (vgettime_t)vdso_sym(version, name[1]);
if (!vdso_clock_gettime)
printf("Warning: failed to find clock_gettime in vDSO\n");
#if defined(VDSO_32BIT)
- vdso_clock_gettime64 = (vgettime64_t)dlsym(vdso, name[5]);
+ vdso_clock_gettime64 = (vgettime64_t)vdso_sym(version, name[5]);
if (!vdso_clock_gettime64)
printf("Warning: failed to find clock_gettime64 in vDSO\n");
#endif
- vdso_gettimeofday = (vgtod_t)dlsym(vdso, name[0]);
+ vdso_gettimeofday = (vgtod_t)vdso_sym(version, name[0]);
if (!vdso_gettimeofday)
printf("Warning: failed to find gettimeofday in vDSO\n");
@@ -429,6 +424,7 @@ static void test_gettimeofday(void)
int main(int argc, char **argv)
{
+ version = versions[VDSO_VERSION];
name = (const char **)&names[VDSO_NAMES];
fill_function_pointers();
^ permalink raw reply [flat|nested] 19+ messages in thread* [tip: timers/vdso] selftests: vDSO: vdso_test_correctness: Use facilities from parse_vdso.c
2026-02-27 6:46 ` [PATCH v2 5/6] selftests: vDSO: vdso_test_correctness: Use facilities from parse_vdso.c Thomas Weißschuh
2026-03-11 9:31 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
@ 2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
1 sibling, 0 replies; 19+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-03-11 14:51 UTC (permalink / raw)
To: linux-tip-commits
Cc: thomas.weissschuh, Thomas Gleixner, Borislav Petkov (AMD),
x86, linux-kernel
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: a8b22a158a47e459d4d353600b1405391bbfb567
Gitweb: https://git.kernel.org/tip/a8b22a158a47e459d4d353600b1405391bbfb567
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Fri, 27 Feb 2026 07:46:00 +01:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Wed, 11 Mar 2026 15:23:18 +01:00
selftests: vDSO: vdso_test_correctness: Use facilities from parse_vdso.c
The soname from the vDSO is not a public API. Furthermore it requires
libc to implement dlsym() and friends.
Use the facilities from parse_vdso.c instead which uses the official
vDSO ABI to find it, aligned with the other vDSO selftests.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-5-d84830fa8beb@linutronix.de
---
tools/testing/selftests/vDSO/Makefile | 4 +-
tools/testing/selftests/vDSO/vdso_test_correctness.c | 30 ++++-------
2 files changed, 14 insertions(+), 20 deletions(-)
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index 2de5cef..a61047b 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -26,13 +26,11 @@ CFLAGS_NOLIBC := -nostdlib -nostdinc -ffreestanding -fno-asynchronous-unwind-tab
$(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c
$(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c
$(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c
+$(OUTPUT)/vdso_test_correctness: parse_vdso.c vdso_test_correctness.c
$(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c | headers
$(OUTPUT)/vdso_standalone_test_x86: CFLAGS:=$(CFLAGS_NOLIBC) $(CFLAGS)
-$(OUTPUT)/vdso_test_correctness: vdso_test_correctness.c
-$(OUTPUT)/vdso_test_correctness: LDFLAGS += -ldl
-
$(OUTPUT)/vdso_test_getrandom: parse_vdso.c
$(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \
$(KHDR_INCLUDES) \
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index 9b56488..a94ab4d 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -11,18 +11,20 @@
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
+#include <sys/auxv.h>
#include <sys/syscall.h>
-#include <dlfcn.h>
#include <string.h>
#include <errno.h>
#include <sched.h>
#include <stdbool.h>
#include <limits.h>
+#include "parse_vdso.h"
#include "vdso_config.h"
#include "vdso_call.h"
#include "kselftest.h"
+static const char *version;
static const char **name;
#ifndef __NR_clock_gettime64
@@ -102,39 +104,32 @@ static void *vsyscall_getcpu(void)
static void fill_function_pointers(void)
{
- void *vdso = dlopen("linux-vdso.so.1",
- RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (!vdso)
- vdso = dlopen("linux-gate.so.1",
- RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (!vdso)
- vdso = dlopen("linux-vdso32.so.1",
- RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (!vdso)
- vdso = dlopen("linux-vdso64.so.1",
- RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
- if (!vdso) {
+ unsigned long sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR);
+
+ if (!sysinfo_ehdr) {
printf("[WARN]\tfailed to find vDSO\n");
return;
}
- vdso_getcpu = (getcpu_t)dlsym(vdso, name[4]);
+ vdso_init_from_sysinfo_ehdr(sysinfo_ehdr);
+
+ vdso_getcpu = (getcpu_t)vdso_sym(version, name[4]);
if (!vdso_getcpu)
printf("Warning: failed to find getcpu in vDSO\n");
vgetcpu = (getcpu_t) vsyscall_getcpu();
- vdso_clock_gettime = (vgettime_t)dlsym(vdso, name[1]);
+ vdso_clock_gettime = (vgettime_t)vdso_sym(version, name[1]);
if (!vdso_clock_gettime)
printf("Warning: failed to find clock_gettime in vDSO\n");
#if defined(VDSO_32BIT)
- vdso_clock_gettime64 = (vgettime64_t)dlsym(vdso, name[5]);
+ vdso_clock_gettime64 = (vgettime64_t)vdso_sym(version, name[5]);
if (!vdso_clock_gettime64)
printf("Warning: failed to find clock_gettime64 in vDSO\n");
#endif
- vdso_gettimeofday = (vgtod_t)dlsym(vdso, name[0]);
+ vdso_gettimeofday = (vgtod_t)vdso_sym(version, name[0]);
if (!vdso_gettimeofday)
printf("Warning: failed to find gettimeofday in vDSO\n");
@@ -429,6 +424,7 @@ static void test_gettimeofday(void)
int main(int argc, char **argv)
{
+ version = versions[VDSO_VERSION];
name = (const char **)&names[VDSO_NAMES];
fill_function_pointers();
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 6/6] selftests: vDSO: vdso_test_correctness: Add a test for time()
2026-02-27 6:45 [PATCH v2 0/6] selftests: vDSO: Assorted cleanups and improvements Thomas Weißschuh
` (4 preceding siblings ...)
2026-02-27 6:46 ` [PATCH v2 5/6] selftests: vDSO: vdso_test_correctness: Use facilities from parse_vdso.c Thomas Weißschuh
@ 2026-02-27 6:46 ` Thomas Weißschuh
2026-03-11 9:31 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
5 siblings, 2 replies; 19+ messages in thread
From: Thomas Weißschuh @ 2026-02-27 6:46 UTC (permalink / raw)
To: Andy Lutomirski, Thomas Gleixner, Vincenzo Frascino, Shuah Khan
Cc: linux-kernel, linux-kselftest, Thomas Weißschuh
Extend the test to also cover the time() function.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
.../testing/selftests/vDSO/vdso_test_correctness.c | 66 ++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index a94ab4d597b1..5c5a07dd1128 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -55,6 +55,10 @@ typedef long (*vgtod_t)(struct timeval *tv, struct timezone *tz);
vgtod_t vdso_gettimeofday;
+typedef time_t (*vtime_t)(__kernel_time_t *tloc);
+
+vtime_t vdso_time;
+
typedef long (*getcpu_t)(unsigned *, unsigned *, void *);
getcpu_t vgetcpu;
@@ -133,6 +137,10 @@ static void fill_function_pointers(void)
if (!vdso_gettimeofday)
printf("Warning: failed to find gettimeofday in vDSO\n");
+ vdso_time = (vtime_t)vdso_sym(version, name[2]);
+ if (!vdso_time)
+ printf("Warning: failed to find time in vDSO\n");
+
}
static long sys_getcpu(unsigned * cpu, unsigned * node,
@@ -156,6 +164,16 @@ static inline int sys_gettimeofday(struct timeval *tv, struct timezone *tz)
return syscall(__NR_gettimeofday, tv, tz);
}
+static inline __kernel_old_time_t sys_time(__kernel_old_time_t *tloc)
+{
+#ifdef __NR_time
+ return syscall(__NR_time, tloc);
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
+}
+
static void test_getcpu(void)
{
printf("[RUN]\tTesting getcpu...\n");
@@ -422,6 +440,53 @@ static void test_gettimeofday(void)
VDSO_CALL(vdso_gettimeofday, 2, &vdso, NULL);
}
+static void test_time(void)
+{
+ __kernel_old_time_t start, end, vdso_ret, vdso_param;
+
+ if (!vdso_time)
+ return;
+
+ printf("[RUN]\tTesting time...\n");
+
+ if (sys_time(&start) < 0) {
+ if (errno == -ENOSYS) {
+ printf("[SKIP]\tNo time() support\n");
+ } else {
+ printf("[FAIL]\tsys_time failed (%d)\n", errno);
+ nerrs++;
+ }
+ return;
+ }
+
+ vdso_ret = VDSO_CALL(vdso_time, 1, &vdso_param);
+ end = sys_time(NULL);
+
+ if (vdso_ret < 0 || end < 0) {
+ printf("[FAIL]\tvDSO returned %d, syscall errno=%d\n",
+ (int)vdso_ret, errno);
+ nerrs++;
+ return;
+ }
+
+ printf("\t%lld %lld %lld\n",
+ (long long)start,
+ (long long)vdso_ret,
+ (long long)end);
+
+ if (vdso_ret != vdso_param) {
+ printf("[FAIL]\tinconsistent return values: %lld %lld\n",
+ (long long)vdso_ret, (long long)vdso_param);
+ nerrs++;
+ return;
+ }
+
+ if (!(start <= vdso_ret) || !(vdso_ret <= end)) {
+ printf("[FAIL]\tTimes are out of sequence\n");
+ nerrs++;
+ }
+}
+
int main(int argc, char **argv)
{
version = versions[VDSO_VERSION];
@@ -432,6 +497,7 @@ int main(int argc, char **argv)
test_clock_gettime();
test_clock_gettime64();
test_gettimeofday();
+ test_time();
/*
* Test getcpu() last so that, if something goes wrong setting affinity,
--
2.53.0
^ permalink raw reply [flat|nested] 19+ messages in thread* [tip: timers/vdso] selftests: vDSO: vdso_test_correctness: Add a test for time()
2026-02-27 6:46 ` [PATCH v2 6/6] selftests: vDSO: vdso_test_correctness: Add a test for time() Thomas Weißschuh
@ 2026-03-11 9:31 ` tip-bot2 for Thomas Weißschuh
2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
1 sibling, 0 replies; 19+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-03-11 9:31 UTC (permalink / raw)
To: linux-tip-commits; +Cc: thomas.weissschuh, Thomas Gleixner, x86, linux-kernel
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: f7178f159b2a36d070fd43b0d751e4e4415ec39e
Gitweb: https://git.kernel.org/tip/f7178f159b2a36d070fd43b0d751e4e4415ec39e
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Fri, 27 Feb 2026 07:46:01 +01:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Wed, 11 Mar 2026 10:27:40 +01:00
selftests: vDSO: vdso_test_correctness: Add a test for time()
Extend the test to also cover the time() function.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-6-d84830fa8beb@linutronix.de
---
tools/testing/selftests/vDSO/vdso_test_correctness.c | 66 +++++++++++-
1 file changed, 66 insertions(+)
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index a94ab4d..5c5a07d 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -55,6 +55,10 @@ typedef long (*vgtod_t)(struct timeval *tv, struct timezone *tz);
vgtod_t vdso_gettimeofday;
+typedef time_t (*vtime_t)(__kernel_time_t *tloc);
+
+vtime_t vdso_time;
+
typedef long (*getcpu_t)(unsigned *, unsigned *, void *);
getcpu_t vgetcpu;
@@ -133,6 +137,10 @@ static void fill_function_pointers(void)
if (!vdso_gettimeofday)
printf("Warning: failed to find gettimeofday in vDSO\n");
+ vdso_time = (vtime_t)vdso_sym(version, name[2]);
+ if (!vdso_time)
+ printf("Warning: failed to find time in vDSO\n");
+
}
static long sys_getcpu(unsigned * cpu, unsigned * node,
@@ -156,6 +164,16 @@ static inline int sys_gettimeofday(struct timeval *tv, struct timezone *tz)
return syscall(__NR_gettimeofday, tv, tz);
}
+static inline __kernel_old_time_t sys_time(__kernel_old_time_t *tloc)
+{
+#ifdef __NR_time
+ return syscall(__NR_time, tloc);
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
+}
+
static void test_getcpu(void)
{
printf("[RUN]\tTesting getcpu...\n");
@@ -422,6 +440,53 @@ static void test_gettimeofday(void)
VDSO_CALL(vdso_gettimeofday, 2, &vdso, NULL);
}
+static void test_time(void)
+{
+ __kernel_old_time_t start, end, vdso_ret, vdso_param;
+
+ if (!vdso_time)
+ return;
+
+ printf("[RUN]\tTesting time...\n");
+
+ if (sys_time(&start) < 0) {
+ if (errno == -ENOSYS) {
+ printf("[SKIP]\tNo time() support\n");
+ } else {
+ printf("[FAIL]\tsys_time failed (%d)\n", errno);
+ nerrs++;
+ }
+ return;
+ }
+
+ vdso_ret = VDSO_CALL(vdso_time, 1, &vdso_param);
+ end = sys_time(NULL);
+
+ if (vdso_ret < 0 || end < 0) {
+ printf("[FAIL]\tvDSO returned %d, syscall errno=%d\n",
+ (int)vdso_ret, errno);
+ nerrs++;
+ return;
+ }
+
+ printf("\t%lld %lld %lld\n",
+ (long long)start,
+ (long long)vdso_ret,
+ (long long)end);
+
+ if (vdso_ret != vdso_param) {
+ printf("[FAIL]\tinconsistent return values: %lld %lld\n",
+ (long long)vdso_ret, (long long)vdso_param);
+ nerrs++;
+ return;
+ }
+
+ if (!(start <= vdso_ret) || !(vdso_ret <= end)) {
+ printf("[FAIL]\tTimes are out of sequence\n");
+ nerrs++;
+ }
+}
+
int main(int argc, char **argv)
{
version = versions[VDSO_VERSION];
@@ -432,6 +497,7 @@ int main(int argc, char **argv)
test_clock_gettime();
test_clock_gettime64();
test_gettimeofday();
+ test_time();
/*
* Test getcpu() last so that, if something goes wrong setting affinity,
^ permalink raw reply [flat|nested] 19+ messages in thread* [tip: timers/vdso] selftests: vDSO: vdso_test_correctness: Add a test for time()
2026-02-27 6:46 ` [PATCH v2 6/6] selftests: vDSO: vdso_test_correctness: Add a test for time() Thomas Weißschuh
2026-03-11 9:31 ` [tip: timers/vdso] " tip-bot2 for Thomas Weißschuh
@ 2026-03-11 14:51 ` tip-bot2 for Thomas Weißschuh
1 sibling, 0 replies; 19+ messages in thread
From: tip-bot2 for Thomas Weißschuh @ 2026-03-11 14:51 UTC (permalink / raw)
To: linux-tip-commits
Cc: thomas.weissschuh, Thomas Gleixner, Borislav Petkov (AMD),
x86, linux-kernel
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: bed0053a6303d908266aaaabf4fa96e2d02a4abc
Gitweb: https://git.kernel.org/tip/bed0053a6303d908266aaaabf4fa96e2d02a4abc
Author: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate: Fri, 27 Feb 2026 07:46:01 +01:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Wed, 11 Mar 2026 15:23:24 +01:00
selftests: vDSO: vdso_test_correctness: Add a test for time()
Extend the test to also cover the time() function.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-6-d84830fa8beb@linutronix.de
---
tools/testing/selftests/vDSO/vdso_test_correctness.c | 66 +++++++++++-
1 file changed, 66 insertions(+)
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index a94ab4d..5c5a07d 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -55,6 +55,10 @@ typedef long (*vgtod_t)(struct timeval *tv, struct timezone *tz);
vgtod_t vdso_gettimeofday;
+typedef time_t (*vtime_t)(__kernel_time_t *tloc);
+
+vtime_t vdso_time;
+
typedef long (*getcpu_t)(unsigned *, unsigned *, void *);
getcpu_t vgetcpu;
@@ -133,6 +137,10 @@ static void fill_function_pointers(void)
if (!vdso_gettimeofday)
printf("Warning: failed to find gettimeofday in vDSO\n");
+ vdso_time = (vtime_t)vdso_sym(version, name[2]);
+ if (!vdso_time)
+ printf("Warning: failed to find time in vDSO\n");
+
}
static long sys_getcpu(unsigned * cpu, unsigned * node,
@@ -156,6 +164,16 @@ static inline int sys_gettimeofday(struct timeval *tv, struct timezone *tz)
return syscall(__NR_gettimeofday, tv, tz);
}
+static inline __kernel_old_time_t sys_time(__kernel_old_time_t *tloc)
+{
+#ifdef __NR_time
+ return syscall(__NR_time, tloc);
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
+}
+
static void test_getcpu(void)
{
printf("[RUN]\tTesting getcpu...\n");
@@ -422,6 +440,53 @@ static void test_gettimeofday(void)
VDSO_CALL(vdso_gettimeofday, 2, &vdso, NULL);
}
+static void test_time(void)
+{
+ __kernel_old_time_t start, end, vdso_ret, vdso_param;
+
+ if (!vdso_time)
+ return;
+
+ printf("[RUN]\tTesting time...\n");
+
+ if (sys_time(&start) < 0) {
+ if (errno == -ENOSYS) {
+ printf("[SKIP]\tNo time() support\n");
+ } else {
+ printf("[FAIL]\tsys_time failed (%d)\n", errno);
+ nerrs++;
+ }
+ return;
+ }
+
+ vdso_ret = VDSO_CALL(vdso_time, 1, &vdso_param);
+ end = sys_time(NULL);
+
+ if (vdso_ret < 0 || end < 0) {
+ printf("[FAIL]\tvDSO returned %d, syscall errno=%d\n",
+ (int)vdso_ret, errno);
+ nerrs++;
+ return;
+ }
+
+ printf("\t%lld %lld %lld\n",
+ (long long)start,
+ (long long)vdso_ret,
+ (long long)end);
+
+ if (vdso_ret != vdso_param) {
+ printf("[FAIL]\tinconsistent return values: %lld %lld\n",
+ (long long)vdso_ret, (long long)vdso_param);
+ nerrs++;
+ return;
+ }
+
+ if (!(start <= vdso_ret) || !(vdso_ret <= end)) {
+ printf("[FAIL]\tTimes are out of sequence\n");
+ nerrs++;
+ }
+}
+
int main(int argc, char **argv)
{
version = versions[VDSO_VERSION];
@@ -432,6 +497,7 @@ int main(int argc, char **argv)
test_clock_gettime();
test_clock_gettime64();
test_gettimeofday();
+ test_time();
/*
* Test getcpu() last so that, if something goes wrong setting affinity,
^ permalink raw reply [flat|nested] 19+ messages in thread