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

vdso/ARM: Make union vdso_data_store available for all architectures

The vDSO data page "union vdso_data_store" is defined in an ARM specific
header file and also defined in several other places.

Move the definition from the ARM header file into the generic vdso datapage
header to make it also usable for others and to prevent code duplication.

Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20240219153939.75719-5-anna-maria@linutronix.de

authored by

Anna-Maria Behnsen and committed by
Thomas Gleixner
a0d2fcd6 4eb0833d

+13 -32
-1
arch/arm/include/asm/elf.h
··· 4 4 5 5 #include <asm/auxvec.h> 6 6 #include <asm/hwcap.h> 7 - #include <asm/vdso_datapage.h> 8 7 9 8 /* 10 9 * ELF register definitions..
-26
arch/arm/include/asm/vdso_datapage.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Adapted from arm64 version. 4 - * 5 - * Copyright (C) 2012 ARM Limited 6 - */ 7 - #ifndef __ASM_VDSO_DATAPAGE_H 8 - #define __ASM_VDSO_DATAPAGE_H 9 - 10 - #ifdef __KERNEL__ 11 - 12 - #ifndef __ASSEMBLY__ 13 - 14 - #include <vdso/datapage.h> 15 - #include <asm/page.h> 16 - 17 - union vdso_data_store { 18 - struct vdso_data data[CS_BASES]; 19 - u8 page[PAGE_SIZE]; 20 - }; 21 - 22 - #endif /* !__ASSEMBLY__ */ 23 - 24 - #endif /* __KERNEL__ */ 25 - 26 - #endif /* __ASM_VDSO_DATAPAGE_H */
+3 -1
arch/arm/kernel/asm-offsets.c
··· 21 21 #include <asm/mpu.h> 22 22 #include <asm/procinfo.h> 23 23 #include <asm/suspend.h> 24 - #include <asm/vdso_datapage.h> 25 24 #include <asm/hardware/cache-l2x0.h> 26 25 #include <linux/kbuild.h> 27 26 #include <linux/arm-smccc.h> 27 + 28 + #include <vdso/datapage.h> 29 + 28 30 #include "signal.h" 29 31 30 32 /*
-4
arch/arm/kernel/vdso.c
··· 21 21 #include <asm/cacheflush.h> 22 22 #include <asm/page.h> 23 23 #include <asm/vdso.h> 24 - #include <asm/vdso_datapage.h> 25 24 #include <clocksource/arm_arch_timer.h> 26 25 #include <vdso/helpers.h> 27 26 #include <vdso/vsyscall.h> ··· 34 35 /* Total number of pages needed for the data and text portions of the VDSO. */ 35 36 unsigned int vdso_total_pages __ro_after_init; 36 37 37 - /* 38 - * The VDSO data page. 39 - */ 40 38 static union vdso_data_store vdso_data_store __page_aligned_data; 41 39 struct vdso_data *vdso_data = vdso_data_store.data; 42 40
+10
include/vdso/datapage.h
··· 19 19 #include <vdso/time32.h> 20 20 #include <vdso/time64.h> 21 21 22 + #include <asm/page.h> 23 + 22 24 #ifdef CONFIG_ARCH_HAS_VDSO_DATA 23 25 #include <asm/vdso/data.h> 24 26 #else ··· 122 120 */ 123 121 extern struct vdso_data _vdso_data[CS_BASES] __attribute__((visibility("hidden"))); 124 122 extern struct vdso_data _timens_data[CS_BASES] __attribute__((visibility("hidden"))); 123 + 124 + /** 125 + * union vdso_data_store - Generic vDSO data page 126 + */ 127 + union vdso_data_store { 128 + struct vdso_data data[CS_BASES]; 129 + u8 page[PAGE_SIZE]; 130 + }; 125 131 126 132 /* 127 133 * The generic vDSO implementation requires that gettimeofday.h