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.

vdso/datastore: Gate time data behind CONFIG_GENERIC_GETTIMEOFDAY

When the generic vDSO does not provide time functions, as for example on
riscv32, then the time data store is not necessary.

Avoid allocating these time data pages when not used.

Fixes: df7fcbefa710 ("vdso: Add generic time data storage")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250826-vdso-cleanups-v1-1-d9b65750e49f@linutronix.de

authored by

Thomas Weißschuh and committed by
Thomas Gleixner
7c0c01a2 b320789d

+3 -3
+3 -3
lib/vdso/datastore.c
··· 11 11 /* 12 12 * The vDSO data page. 13 13 */ 14 - #ifdef CONFIG_HAVE_GENERIC_VDSO 14 + #ifdef CONFIG_GENERIC_GETTIMEOFDAY 15 15 static union { 16 16 struct vdso_time_data data; 17 17 u8 page[PAGE_SIZE]; 18 18 } vdso_time_data_store __page_aligned_data; 19 19 struct vdso_time_data *vdso_k_time_data = &vdso_time_data_store.data; 20 20 static_assert(sizeof(vdso_time_data_store) == PAGE_SIZE); 21 - #endif /* CONFIG_HAVE_GENERIC_VDSO */ 21 + #endif /* CONFIG_GENERIC_GETTIMEOFDAY */ 22 22 23 23 #ifdef CONFIG_VDSO_GETRANDOM 24 24 static union { ··· 46 46 47 47 switch (vmf->pgoff) { 48 48 case VDSO_TIME_PAGE_OFFSET: 49 - if (!IS_ENABLED(CONFIG_HAVE_GENERIC_VDSO)) 49 + if (!IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY)) 50 50 return VM_FAULT_SIGBUS; 51 51 pfn = __phys_to_pfn(__pa_symbol(vdso_k_time_data)); 52 52 if (timens_page) {