Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ARM: VDSO: Remove cntvct_ok global variable

The cntvct_ok variable has not had any external user since commit
c7a18100bdff ("lib/vdso: Avoid highres update if clocksource is not
VDSO capable").

It also only has one user in vdso.c, once during init, so rather than
having the caller of patch_vdso() initialize cntvct_ok, just call
cntvct_functional() directly and avoid the global variable entirely.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/all/20250826-vdso-cleanups-v1-2-d9b65750e49f@linutronix.de

authored by

Rasmus Villemoes and committed by
Thomas Gleixner
39f1ee12 7c0c01a2

+3 -9
-2
arch/arm/include/asm/vdso/vsyscall.h
··· 7 7 #include <vdso/datapage.h> 8 8 #include <asm/cacheflush.h> 9 9 10 - extern bool cntvct_ok; 11 - 12 10 static __always_inline 13 11 void __arch_sync_vdso_time_data(struct vdso_time_data *vdata) 14 12 {
+3 -7
arch/arm/kernel/vdso.c
··· 54 54 char *dynstr; /* ptr to .dynstr section */ 55 55 }; 56 56 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. 59 59 */ 60 - bool cntvct_ok __ro_after_init; 61 - 62 60 static bool __init cntvct_functional(void) 63 61 { 64 62 struct device_node *np; ··· 157 159 * want programs to incur the slight additional overhead of 158 160 * dispatching through the VDSO only to fall back to syscalls. 159 161 */ 160 - if (!cntvct_ok) { 162 + if (!cntvct_functional()) { 161 163 vdso_nullpatch_one(&einfo, "__vdso_gettimeofday"); 162 164 vdso_nullpatch_one(&einfo, "__vdso_clock_gettime"); 163 165 vdso_nullpatch_one(&einfo, "__vdso_clock_gettime64"); ··· 194 196 195 197 vdso_total_pages = VDSO_NR_PAGES; /* for the data/vvar pages */ 196 198 vdso_total_pages += text_pages; 197 - 198 - cntvct_ok = cntvct_functional(); 199 199 200 200 patch_vdso(vdso_start); 201 201