]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ARM: vdso: Remove assembly for datapage access
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Thu, 10 Oct 2024 07:01:09 +0000 (09:01 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 2 Nov 2024 11:37:33 +0000 (12:37 +0100)
vdso/datapage.h provides a hidden declaration for _vdso_data.
When using it the compiler will automatically generate PC-relative
accesses which avoids the need for a custom assembly-based accessor.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20241010-vdso-generic-base-v1-7-b64f0842d512@linutronix.de
arch/arm/include/asm/vdso/gettimeofday.h
arch/arm/vdso/Makefile
arch/arm/vdso/datapage.S [deleted file]
arch/arm/vdso/vdso.lds.S

index 2134cbd5469feef020ef30494b667b93972f9fac..592d3d015ca7298b3bc35871387dbb3e7f819827 100644 (file)
@@ -15,8 +15,6 @@
 
 #define VDSO_HAS_CLOCK_GETRES          1
 
-extern struct vdso_data *__get_datapage(void);
-
 static __always_inline int gettimeofday_fallback(
                                struct __kernel_old_timeval *_tv,
                                struct timezone *_tz)
@@ -139,7 +137,7 @@ static __always_inline u64 __arch_get_hw_counter(int clock_mode,
 
 static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
 {
-       return __get_datapage();
+       return _vdso_data;
 }
 
 #endif /* !__ASSEMBLY__ */
index 01067a2bc43b74cc3a4c071b4a0fbeb0933e9ff7..8a306bbec4a0c4d4b6580fe88187faf9f5422eed 100644 (file)
@@ -5,7 +5,7 @@ include $(srctree)/lib/vdso/Makefile
 
 hostprogs := vdsomunge
 
-obj-vdso := vgettimeofday.o datapage.o note.o
+obj-vdso := vgettimeofday.o note.o
 
 # Build rules
 targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.so.raw vdso.lds
diff --git a/arch/arm/vdso/datapage.S b/arch/arm/vdso/datapage.S
deleted file mode 100644 (file)
index 9cd73b7..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#include <linux/linkage.h>
-#include <asm/asm-offsets.h>
-
-       .align 2
-.L_vdso_data_ptr:
-       .long   _start - . - VDSO_DATA_SIZE
-
-ENTRY(__get_datapage)
-       .fnstart
-       adr     r0, .L_vdso_data_ptr
-       ldr     r1, [r0]
-       add     r0, r0, r1
-       bx      lr
-       .fnend
-ENDPROC(__get_datapage)
index 165d1d2eb76b3cea9b054ffa8906afdffa0eae57..9bfa0f52923c851b6b9e96d4dbb51eb3d5d0960a 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <linux/const.h>
+#include <asm/asm-offsets.h>
 #include <asm/page.h>
 #include <asm/vdso.h>
 
@@ -19,7 +20,7 @@ OUTPUT_ARCH(arm)
 
 SECTIONS
 {
-       PROVIDE(_start = .);
+       PROVIDE(_vdso_data = . - VDSO_DATA_SIZE);
 
        . = SIZEOF_HEADERS;