If CONFIG_COMPAT_32BIT_TIME is disabled then the vDSO should not provide any 32-bit time related functionality. This is the intended effect of the kconfig option and also the fallback system calls would also not be implemented.
Currently the kconfig option does not affect the gettimeofday() syscall, so also keep that in the vDSO. I also tried to introduce some helpers to avoid much of the ifdeffery, but due to the high variance in the architecture-specific glue code these would need to handle they ended up being worse than the current proposal. As a side-effect this will make the self-tests more reliable, as there is now always a matching syscall available for each vDSO function. clock_gettime_time64() was only introduced in v6.19, so libc implementations are likely not using it yet. Signed-off-by: Thomas Weißschuh <[email protected]> --- Changes in v2: - Also handle SPARC. - Drop MIPS cleanup patches. - Also handle gettimeofday(). - Add more static validations. - Rebase on v7.2-rc1. - Link to v1: https://lore.kernel.org/r/[email protected] To: Andy Lutomirski <[email protected]> To: Thomas Gleixner <[email protected]> To: Ingo Molnar <[email protected]> To: Borislav Petkov <[email protected]> To: Dave Hansen <[email protected]> To: [email protected] To: H. Peter Anvin <[email protected]> To: Russell King <[email protected]> To: Catalin Marinas <[email protected]> To: Will Deacon <[email protected]> To: Madhavan Srinivasan <[email protected]> To: Michael Ellerman <[email protected]> To: Nicholas Piggin <[email protected]> To: Christophe Leroy (CS GROUP) <[email protected]> To: Thomas Bogendoerfer <[email protected]> To: Vincenzo Frascino <[email protected]> To: John Stultz <[email protected]> To: Stephen Boyd <[email protected]> To: "David S. Miller" <[email protected]> To: Andreas Larsson <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: Arnd Bergmann <[email protected]> Cc: [email protected] Cc: [email protected] --- Thomas Weißschuh (9): time: Respect COMPAT_32BIT_TIME for old time type functions vdso/gettimeofday: Validate system call existence for time() and gettimeofday() x86/vdso: Respect COMPAT_32BIT_TIME arm64: vdso32: Respect COMPAT_32BIT_TIME ARM: VDSO: Respect COMPAT_32BIT_TIME powerpc/vdso: Respect COMPAT_32BIT_TIME MIPS: VDSO: Respect COMPAT_32BIT_TIME sparc: vdso: Respect COMPAT_32BIT_TIME vdso/gettimeofday: Verify COMPAT_32BIT_TIME interactions arch/arm/vdso/vdso.lds.S | 2 ++ arch/arm/vdso/vgettimeofday.c | 14 ++++++++------ arch/arm64/kernel/vdso32/vdso.lds.S | 2 ++ arch/arm64/kernel/vdso32/vgettimeofday.c | 14 ++++++++------ arch/mips/vdso/vdso.lds.S | 2 ++ arch/mips/vdso/vgettimeofday.c | 3 +++ arch/powerpc/kernel/vdso/gettimeofday.S | 8 ++++++++ arch/powerpc/kernel/vdso/vdso32.lds.S | 10 ++++++---- arch/powerpc/kernel/vdso/vgettimeofday.c | 16 ++++++++++------ arch/sparc/vdso/vclock_gettime.c | 4 ++++ arch/sparc/vdso/vdso32/vdso32.lds.S | 6 ++++-- arch/x86/entry/vdso/common/vclock_gettime.c | 20 ++++++++++++-------- arch/x86/entry/vdso/vdso32/vdso32.lds.S | 2 ++ kernel/sys_ni.c | 4 ++++ kernel/time/time.c | 24 ++++++++++++++++++++---- lib/vdso/gettimeofday.c | 20 ++++++++++++++++++++ 16 files changed, 115 insertions(+), 36 deletions(-) --- base-commit: e6da2429169af9b33f3629b69905d89bb5ee9e64 change-id: 20260113-vdso-compat_32bit_time-e808763e976a Best regards, -- Thomas Weißschuh (Schneider Electric) <[email protected]>
