Extend the vDSO for fast-path access to auxiliary clocks (CLOCK_AUX). The implementation is based on the generic vDSO infrastructure and works for all its supported architectures. Namely x86, arm, arm64, riscv, powerpc, loongarch and s390. No changes to userspace are necessary.
Based on timers/ptp of tip.git.
This also depends on v6.16-rc2 *exactly*. The specific dependency is commit 11fcf368506d ("uapi: bitops: use UAPI-safe variant of BITS_PER_LONG again"), which is available in v6.16-rc2. Unfortunately that got broken again in v6.16-rc3 by commit fc92099902fb ("tools headers: Synchronize linux/bits.h with the kernel sources"). Another fix for this is pending [0] and should make it into v6.16.
[0] https://lore.kernel.org/lkml/20250630-uapi-genmask-v1-1-eb0ad956a83e@linutro...
Signed-off-by: Thomas Weißschuh thomas.weissschuh@linutronix.de --- Thomas Weißschuh (14): selftests/timers: Add testcase for auxiliary clocks vdso/vsyscall: Introduce a helper to fill clock configurations vdso/vsyscall: Split up __arch_update_vsyscall() into __arch_update_vdso_clock() vdso/helpers: Add helpers for seqlocks of single vdso_clock vdso/gettimeofday: Return bool from clock_getres() helpers vdso/gettimeofday: Return bool from clock_gettime() helpers vdso/gettimeofday: Introduce vdso_clockid_valid() vdso/gettimeofday: Introduce vdso_set_timespec() vdso/gettimeofday: Introduce vdso_get_timestamp() vdso: Introduce aux_clock_resolution_ns() vdso/vsyscall: Update auxiliary clock data in the datapage vdso/gettimeofday: Add support for auxiliary clocks Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers" selftests/timers/auxclock: Test vDSO functionality
arch/arm64/include/asm/vdso/vsyscall.h | 7 +- include/asm-generic/vdso/vsyscall.h | 6 +- include/linux/timekeeper_internal.h | 13 + include/vdso/auxclock.h | 13 + include/vdso/datapage.h | 5 + include/vdso/helpers.h | 40 ++- kernel/time/namespace.c | 5 + kernel/time/timekeeping.c | 18 +- kernel/time/vsyscall.c | 70 ++++-- lib/vdso/gettimeofday.c | 212 ++++++++++------ tools/testing/selftests/timers/.gitignore | 1 + tools/testing/selftests/timers/Makefile | 2 +- tools/testing/selftests/timers/auxclock.c | 406 ++++++++++++++++++++++++++++++ tools/testing/selftests/vDSO/Makefile | 2 - tools/testing/selftests/vDSO/parse_vdso.c | 3 +- 15 files changed, 683 insertions(+), 120 deletions(-) --- base-commit: 4e83b31e48cf2e62aeaed5cd9875c851e36a90d9 change-id: 20250630-vdso-auxclock-97abdf8e042a
Best regards,