summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/vdso_datapage.h
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2019-12-02 08:57:30 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2020-01-23 11:31:15 +0100
commitec0895f08f99515194e9fcfe1338becf6f759d38 (patch)
tree7cc3179bddb320ffaac953354f910a27f4bf939f /arch/powerpc/include/asm/vdso_datapage.h
parentpowerpc/vdso32: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE (diff)
downloadlinux-ec0895f08f99515194e9fcfe1338becf6f759d38.tar.xz
linux-ec0895f08f99515194e9fcfe1338becf6f759d38.zip
powerpc/vdso32: inline __get_datapage()
__get_datapage() is only a few instructions to retrieve the address of the page where the kernel stores data to the VDSO. By inlining this function into its users, a bl/blr pair and a mflr/mtlr pair is avoided, plus a few reg moves. The improvement is noticeable (about 55 nsec/call on an 8xx) vdsotest before the patch: gettimeofday: vdso: 731 nsec/call clock-gettime-realtime-coarse: vdso: 668 nsec/call clock-gettime-monotonic-coarse: vdso: 745 nsec/call vdsotest after the patch: gettimeofday: vdso: 677 nsec/call clock-gettime-realtime-coarse: vdso: 613 nsec/call clock-gettime-monotonic-coarse: vdso: 690 nsec/call Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/c39ef7f3dfa25356b01e211d539671f279086c09.1575273217.git.christophe.leroy@c-s.fr
Diffstat (limited to 'arch/powerpc/include/asm/vdso_datapage.h')
-rw-r--r--arch/powerpc/include/asm/vdso_datapage.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/vdso_datapage.h b/arch/powerpc/include/asm/vdso_datapage.h
index 40f13f3626d3..ee5319a6f4e3 100644
--- a/arch/powerpc/include/asm/vdso_datapage.h
+++ b/arch/powerpc/include/asm/vdso_datapage.h
@@ -118,6 +118,16 @@ struct vdso_data {
extern struct vdso_data *vdso_data;
+#else /* __ASSEMBLY__ */
+
+.macro get_datapage ptr, tmp
+ bcl 20, 31, .+4
+ mflr \ptr
+ addi \ptr, \ptr, (__kernel_datapage_offset - (.-4))@l
+ lwz \tmp, 0(\ptr)
+ add \ptr, \tmp, \ptr
+.endm
+
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */