Skip to content

Commit 4b81e2e

Browse files
committed
Merge tag 'timers-vdso-2025-09-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull VDSO updates from Thomas Gleixner: - Further consolidation of the VDSO infrastructure and the common data store - Simplification of the related Kconfig logic - Improve the VDSO selftest suite * tag 'timers-vdso-2025-09-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: selftests: vDSO: Drop vdso_test_clock_getres selftests: vDSO: vdso_test_abi: Add tests for clock_gettime64() selftests: vDSO: vdso_test_abi: Test CPUTIME clocks selftests: vDSO: vdso_test_abi: Use explicit indices for name array selftests: vDSO: vdso_test_abi: Drop clock availability tests selftests: vDSO: vdso_test_abi: Use ksft_finished() selftests: vDSO: vdso_test_abi: Correctly skip whole test with missing vDSO selftests: vDSO: Fix -Wunitialized in powerpc VDSO_CALL() wrapper vdso: Add struct __kernel_old_timeval forward declaration to gettime.h vdso: Gate VDSO_GETRANDOM behind HAVE_GENERIC_VDSO vdso: Drop Kconfig GENERIC_VDSO_TIME_NS vdso: Drop Kconfig GENERIC_VDSO_DATA_STORE vdso: Drop kconfig GENERIC_COMPAT_VDSO vdso: Drop kconfig GENERIC_VDSO_32 riscv: vdso: Untangle Kconfig logic time: Build generic update_vsyscall() only with generic time vDSO vdso/gettimeofday: Remove !CONFIG_TIME_NS stubs vdso: Move ENABLE_COMPAT_VDSO from core to arm64 ARM: VDSO: Remove cntvct_ok global variable vdso/datastore: Gate time data behind CONFIG_GENERIC_GETTIMEOFDAY
2 parents 70de557 + e82bf75 commit 4b81e2e

File tree

30 files changed

+91
-285
lines changed

30 files changed

+91
-285
lines changed

arch/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ config HAVE_SPARSE_SYSCALL_NR
16571657
related optimizations for a given architecture.
16581658

16591659
config ARCH_HAS_VDSO_ARCH_DATA
1660-
depends on GENERIC_VDSO_DATA_STORE
1660+
depends on HAVE_GENERIC_VDSO
16611661
bool
16621662

16631663
config ARCH_HAS_VDSO_TIME_DATA

arch/arm/include/asm/vdso/vsyscall.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#include <vdso/datapage.h>
88
#include <asm/cacheflush.h>
99

10-
extern bool cntvct_ok;
11-
1210
static __always_inline
1311
void __arch_sync_vdso_time_data(struct vdso_time_data *vdata)
1412
{

arch/arm/kernel/vdso.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,9 @@ struct elfinfo {
5454
char *dynstr; /* ptr to .dynstr section */
5555
};
5656

57-
/* Cached result of boot-time check for whether the arch timer exists,
58-
* and if so, whether the virtual counter is useable.
57+
/* Boot-time check for whether the arch timer exists, and if so,
58+
* whether the virtual counter is usable.
5959
*/
60-
bool cntvct_ok __ro_after_init;
61-
6260
static bool __init cntvct_functional(void)
6361
{
6462
struct device_node *np;
@@ -159,7 +157,7 @@ static void __init patch_vdso(void *ehdr)
159157
* want programs to incur the slight additional overhead of
160158
* dispatching through the VDSO only to fall back to syscalls.
161159
*/
162-
if (!cntvct_ok) {
160+
if (!cntvct_functional()) {
163161
vdso_nullpatch_one(&einfo, "__vdso_gettimeofday");
164162
vdso_nullpatch_one(&einfo, "__vdso_clock_gettime");
165163
vdso_nullpatch_one(&einfo, "__vdso_clock_gettime64");
@@ -197,8 +195,6 @@ static int __init vdso_init(void)
197195
vdso_total_pages = VDSO_NR_PAGES; /* for the data/vvar pages */
198196
vdso_total_pages += text_pages;
199197

200-
cntvct_ok = cntvct_functional();
201-
202198
patch_vdso(vdso_start);
203199

204200
return 0;

arch/arm/mm/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,9 +926,7 @@ config VDSO
926926
default y if ARM_ARCH_TIMER
927927
select HAVE_GENERIC_VDSO
928928
select GENERIC_TIME_VSYSCALL
929-
select GENERIC_VDSO_32
930929
select GENERIC_GETTIMEOFDAY
931-
select GENERIC_VDSO_DATA_STORE
932930
help
933931
Place in the process address space an ELF shared object
934932
providing fast implementations of gettimeofday and

arch/arm64/Kconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ config ARM64
166166
select GENERIC_SMP_IDLE_THREAD
167167
select GENERIC_TIME_VSYSCALL
168168
select GENERIC_GETTIMEOFDAY
169-
select GENERIC_VDSO_DATA_STORE
170-
select GENERIC_VDSO_TIME_NS
171169
select HARDIRQS_SW_RESEND
172170
select HAS_IOPORT
173171
select HAVE_MOVE_PMD
@@ -1750,7 +1748,6 @@ config COMPAT_VDSO
17501748
bool "Enable vDSO for 32-bit applications"
17511749
depends on !CPU_BIG_ENDIAN
17521750
depends on (CC_IS_CLANG && LD_IS_LLD) || "$(CROSS_COMPILE_COMPAT)" != ""
1753-
select GENERIC_COMPAT_VDSO
17541751
default y
17551752
help
17561753
Place in the process address space of 32-bit applications an

arch/arm64/include/asm/vdso/compat_barrier.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77

88
#ifndef __ASSEMBLY__
99
/*
10-
* Warning: This code is meant to be used with
11-
* ENABLE_COMPAT_VDSO only.
10+
* Warning: This code is meant to be used from the compat vDSO only.
1211
*/
13-
#ifndef ENABLE_COMPAT_VDSO
14-
#error This header is meant to be used with ENABLE_COMPAT_VDSO only
12+
#ifdef __arch64__
13+
#error This header is meant to be used with from the compat vDSO only
1514
#endif
1615

1716
#ifdef dmb

arch/arm64/include/asm/vdso/compat_gettimeofday.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/*
33
* Copyright (C) 2018 ARM Limited
44
*/
5-
#ifndef __ASM_VDSO_GETTIMEOFDAY_H
6-
#define __ASM_VDSO_GETTIMEOFDAY_H
5+
#ifndef __ASM_VDSO_COMPAT_GETTIMEOFDAY_H
6+
#define __ASM_VDSO_COMPAT_GETTIMEOFDAY_H
77

88
#ifndef __ASSEMBLY__
99

@@ -163,4 +163,4 @@ static inline bool vdso_clocksource_ok(const struct vdso_clock *vc)
163163

164164
#endif /* !__ASSEMBLY__ */
165165

166-
#endif /* __ASM_VDSO_GETTIMEOFDAY_H */
166+
#endif /* __ASM_VDSO_COMPAT_GETTIMEOFDAY_H */

arch/arm64/include/asm/vdso/gettimeofday.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#ifndef __ASM_VDSO_GETTIMEOFDAY_H
66
#define __ASM_VDSO_GETTIMEOFDAY_H
77

8+
#ifdef __aarch64__
9+
810
#ifndef __ASSEMBLY__
911

1012
#include <asm/alternative.h>
@@ -96,4 +98,10 @@ static __always_inline const struct vdso_time_data *__arch_get_vdso_u_time_data(
9698

9799
#endif /* !__ASSEMBLY__ */
98100

101+
#else /* !__aarch64__ */
102+
103+
#include "compat_gettimeofday.h"
104+
105+
#endif /* __aarch64__ */
106+
99107
#endif /* __ASM_VDSO_GETTIMEOFDAY_H */

arch/arm64/kernel/vdso32/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ VDSO_CAFLAGS += -DDISABLE_BRANCH_PROFILING
5757
VDSO_CAFLAGS += -march=armv8-a
5858

5959
VDSO_CFLAGS := $(VDSO_CAFLAGS)
60-
VDSO_CFLAGS += -DENABLE_COMPAT_VDSO=1
6160
# KBUILD_CFLAGS from top-level Makefile
6261
VDSO_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
6362
-fno-strict-aliasing -fno-common \

arch/loongarch/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ config LOONGARCH
110110
select GENERIC_SCHED_CLOCK
111111
select GENERIC_SMP_IDLE_THREAD
112112
select GENERIC_TIME_VSYSCALL
113-
select GENERIC_VDSO_DATA_STORE
114-
select GENERIC_VDSO_TIME_NS
115113
select GPIOLIB
116114
select HAS_IOPORT
117115
select HAVE_ARCH_AUDITSYSCALL

0 commit comments

Comments
 (0)