]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
MIPS: VDSO: Only map the data pages when the vDSO is used
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Thu, 21 May 2026 06:53:18 +0000 (08:53 +0200)
committerThomas Gleixner <tglx@kernel.org>
Thu, 4 Jun 2026 16:22:45 +0000 (18:22 +0200)
A future change will make it possible to disable the time-related vDSO.
In that case there is no point in calling into the datastore.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Link: https://patch.msgid.link/20260521-vdso-mips-kconfig-v1-4-2f79dcd6c78f@linutronix.de
arch/mips/Kconfig
arch/mips/kernel/vdso.c

index b041d3daf7c7a4073ed7a673111be83cd81ccd05..f56e1a5f5cd9d0154b91aae9ce0a300a1bb10285 100644 (file)
@@ -74,7 +74,6 @@ config MIPS
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_FUNCTION_TRACER
        select HAVE_GCC_PLUGINS
-       select HAVE_GENERIC_VDSO
        select HAVE_IOREMAP_PROT
        select HAVE_IRQ_EXIT_ON_IRQ_STACK
        select HAVE_IRQ_TIME_ACCOUNTING
@@ -3171,6 +3170,7 @@ config MIPS_EXTERNAL_TIMER
 config MIPS_GENERIC_GETTIMEOFDAY
        def_bool y
        select GENERIC_GETTIMEOFDAY
+       select HAVE_GENERIC_VDSO
 
 menu "CPU Power Management"
 
index 2fa4df3e46e47b5c9675aeb00ebb96ac3353c68e..bd1fc17d3975dcc7bd2a4881420d4318664d2bbf 100644 (file)
@@ -129,7 +129,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
         * This ensures that when the kernel updates the VDSO data userland
         * will observe it without requiring cache invalidations.
         */
-       if (cpu_has_dc_aliases) {
+       if (cpu_has_dc_aliases && IS_ENABLED(CONFIG_HAVE_GENERIC_VDSO)) {
                base = __ALIGN_MASK(base, shm_align_mask);
                base += ((unsigned long)vdso_k_time_data - gic_size) & shm_align_mask;
        }
@@ -137,10 +137,12 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
        data_addr = base + gic_size;
        vdso_addr = data_addr + VDSO_NR_PAGES * PAGE_SIZE;
 
-       vma = vdso_install_vvar_mapping(mm, data_addr);
-       if (IS_ERR(vma)) {
-               ret = PTR_ERR(vma);
-               goto out;
+       if (IS_ENABLED(CONFIG_HAVE_GENERIC_VDSO)) {
+               vma = vdso_install_vvar_mapping(mm, data_addr);
+               if (IS_ERR(vma)) {
+                       ret = PTR_ERR(vma);
+                       goto out;
+               }
        }
 
        /* Map GIC user page. */