powerpc/vdso: Simplify __get_datapage()
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Sun, 27 Sep 2020 09:16:31 +0000 (09:16 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 3 Dec 2020 14:01:17 +0000 (01:01 +1100)
The VDSO datapage and the text pages are always located immediately
next to each other, so it can be hardcoded without an indirection
through __kernel_datapage_offset

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b08f5ef99d64cfc38f79b7ad5310d9b4d2479eeb.1601197618.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/vdso_datapage.h
arch/powerpc/kernel/vdso32/vdso32.lds.S
arch/powerpc/kernel/vdso64/vdso64.lds.S

index 3d996db05acd9a74df15125f5fee91f870dfbf11..535ba737397d9123073d186b44ae9667de482255 100644 (file)
@@ -105,10 +105,12 @@ extern struct vdso_arch_data *vdso_data;
 
 .macro get_datapage ptr, tmp
        bcl     20, 31, .+4
+999:
        mflr    \ptr
-       addi    \ptr, \ptr, (__kernel_datapage_offset - (.-4))@l
-       lwz     \tmp, 0(\ptr)
-       add     \ptr, \tmp, \ptr
+#if CONFIG_PPC_PAGE_SHIFT > 14
+       addis   \ptr, \ptr, (_vdso_datapage - 999b)@ha
+#endif
+       addi    \ptr, \ptr, (_vdso_datapage - 999b)@l
 .endm
 
 #endif /* __ASSEMBLY__ */
index 27a2d03c72d50d40974fe97e69043b480fae9958..88a2976e99428c920ea48c91c90733e098b8196a 100644 (file)
@@ -4,6 +4,7 @@
  * library
  */
 #include <asm/vdso.h>
+#include <asm/page.h>
 
 #ifdef __LITTLE_ENDIAN__
 OUTPUT_FORMAT("elf32-powerpcle", "elf32-powerpcle", "elf32-powerpcle")
@@ -15,6 +16,7 @@ ENTRY(_start)
 
 SECTIONS
 {
+       PROVIDE(_vdso_datapage = . - PAGE_SIZE);
        . = VDSO32_LBASE + SIZEOF_HEADERS;
 
        .hash           : { *(.hash) }                  :text
index 71be083b24ed63fc03053c070ebbba822a293410..e43731386469de88c2c8b026d662775b445271ba 100644 (file)
@@ -4,6 +4,7 @@
  * library
  */
 #include <asm/vdso.h>
+#include <asm/page.h>
 
 #ifdef __LITTLE_ENDIAN__
 OUTPUT_FORMAT("elf64-powerpcle", "elf64-powerpcle", "elf64-powerpcle")
@@ -15,6 +16,7 @@ ENTRY(_start)
 
 SECTIONS
 {
+       PROVIDE(_vdso_datapage = . - PAGE_SIZE);
        . = VDSO64_LBASE + SIZEOF_HEADERS;
 
        .hash           : { *(.hash) }                  :text