From b1576fec7f4dd4657694fefc97fda4cf28ec68e9 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 4 Feb 2014 16:04:35 +1100 Subject: powerpc: No need to use dot symbols when branching to a function binutils is smart enough to know that a branch to a function descriptor is actually a branch to the functions text address. Alan tells me that binutils has been doing this for 9 years. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/ppc_asm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/powerpc/include/asm/ppc_asm.h') diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 6586a40a46ce..3128ba3ba7a0 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -57,7 +57,7 @@ BEGIN_FW_FTR_SECTION; \ LDX_BE r10,0,r10; /* get log write index */ \ cmpd cr1,r11,r10; \ beq+ cr1,33f; \ - bl .accumulate_stolen_time; \ + bl accumulate_stolen_time; \ ld r12,_MSR(r1); \ andi. r10,r12,MSR_PR; /* Restore cr0 (coming from user) */ \ 33: \ -- cgit v1.2.3 From a0e971ffb9d9dae3b9892fb548bd2497db758f60 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 4 Feb 2014 16:06:25 +1100 Subject: powerpc: Remove _INIT_GLOBAL(), _STATIC() and _INIT_STATIC() Now there are no users of _INIT_GLOBAL(), _STATIC() and _INIT_STATIC() we can remove them. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/ppc_asm.h | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'arch/powerpc/include/asm/ppc_asm.h') diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 3128ba3ba7a0..35b23a6584cb 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -209,20 +209,6 @@ name: \ .type GLUE(.,name),@function; \ GLUE(.,name): -#define _INIT_GLOBAL(name) \ - __REF; \ - .align 2 ; \ - .globl name; \ - .globl GLUE(.,name); \ - .section ".opd","aw"; \ -name: \ - .quad GLUE(.,name); \ - .quad .TOC.@tocbase; \ - .quad 0; \ - .previous; \ - .type GLUE(.,name),@function; \ -GLUE(.,name): - #define _KPROBE(name) \ .section ".kprobes.text","a"; \ .align 2 ; \ @@ -237,30 +223,6 @@ name: \ .type GLUE(.,name),@function; \ GLUE(.,name): -#define _STATIC(name) \ - .section ".text"; \ - .align 2 ; \ - .section ".opd","aw"; \ -name: \ - .quad GLUE(.,name); \ - .quad .TOC.@tocbase; \ - .quad 0; \ - .previous; \ - .type GLUE(.,name),@function; \ -GLUE(.,name): - -#define _INIT_STATIC(name) \ - __REF; \ - .align 2 ; \ - .section ".opd","aw"; \ -name: \ - .quad GLUE(.,name); \ - .quad .TOC.@tocbase; \ - .quad 0; \ - .previous; \ - .type GLUE(.,name),@function; \ -GLUE(.,name): - #else /* 32-bit */ #define _ENTRY(n) \ -- cgit v1.2.3 From c1fb019477c27bfe309be282d178a08e56f05249 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 4 Feb 2014 16:07:01 +1100 Subject: powerpc: Create DOTSYM to wrap dot symbol usage There are a few places we have to use dot symbols with the current ABI - the syscall table and the kvm hcall table. Wrap both of these with a new macro called DOTSYM so it will be easy to transition away from dot symbols in a future ABI. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/ppc_asm.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/powerpc/include/asm/ppc_asm.h') diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 35b23a6584cb..61992d8f99df 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -223,6 +223,8 @@ name: \ .type GLUE(.,name),@function; \ GLUE(.,name): +#define DOTSYM(a) GLUE(.,a) + #else /* 32-bit */ #define _ENTRY(n) \ -- cgit v1.2.3 From 7167af7cebedc7c2051184fef0e165aeb67d0b9d Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 4 Feb 2014 16:07:20 +1100 Subject: powerpc: Remove function descriptors and dot symbols on new ABI ABIv2 doesn't have function descriptors or dot symbols. One new thing it does add is a function global and a local entry point, so add that to our _GLOBAL macro. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/ppc_asm.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'arch/powerpc/include/asm/ppc_asm.h') diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 61992d8f99df..5394d41a7140 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -192,6 +192,26 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) #define __STK_PARAM(i) (48 + ((i)-3)*8) #define STK_PARAM(i) __STK_PARAM(__REG_##i) +#if defined(_CALL_ELF) && _CALL_ELF == 2 + +#define _GLOBAL(name) \ + .section ".text"; \ + .align 2 ; \ + .type name,@function; \ + .globl name; \ +name: + +#define _KPROBE(name) \ + .section ".kprobes.text","a"; \ + .align 2 ; \ + .type name,@function; \ + .globl name; \ +name: + +#define DOTSYM(a) a + +#else + #define XGLUE(a,b) a##b #define GLUE(a,b) XGLUE(a,b) @@ -225,6 +245,8 @@ GLUE(.,name): #define DOTSYM(a) GLUE(.,a) +#endif + #else /* 32-bit */ #define _ENTRY(n) \ -- cgit v1.2.3 From b37c10d128a2fa3256d4e67c184177270eac4b86 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 4 Feb 2014 16:09:02 +1100 Subject: powerpc: Fix ABIv2 issues with stack offsets in assembly code Fix STK_PARAM and use it instead of hardcoding ABIv1 offsets. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/ppc_asm.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/powerpc/include/asm/ppc_asm.h') diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 5394d41a7140..3185d11b6691 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -189,7 +189,11 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) #define __STK_REG(i) (112 + ((i)-14)*8) #define STK_REG(i) __STK_REG(__REG_##i) +#if defined(_CALL_ELF) && _CALL_ELF == 2 +#define __STK_PARAM(i) (32 + ((i)-3)*8) +#else #define __STK_PARAM(i) (48 + ((i)-3)*8) +#endif #define STK_PARAM(i) __STK_PARAM(__REG_##i) #if defined(_CALL_ELF) && _CALL_ELF == 2 -- cgit v1.2.3 From 6403105bfda4d6934b39aeb85ff818b185b42de8 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Mon, 10 Mar 2014 10:52:17 +1100 Subject: powerpc/tm: Fix GOT save offset for ABIv2 The r2 TOC/GOT save offset is 40 on ABIv1 and 24 on ABIv2. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/ppc_asm.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/powerpc/include/asm/ppc_asm.h') diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 3185d11b6691..2cc2511ff076 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -190,8 +190,10 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) #define STK_REG(i) __STK_REG(__REG_##i) #if defined(_CALL_ELF) && _CALL_ELF == 2 +#define STK_GOT 24 #define __STK_PARAM(i) (32 + ((i)-3)*8) #else +#define STK_GOT 40 #define __STK_PARAM(i) (48 + ((i)-3)*8) #endif #define STK_PARAM(i) __STK_PARAM(__REG_##i) -- cgit v1.2.3 From 169c7cee3131cdf5e2f2d2a6c722c7db0283bcd5 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Thu, 3 Apr 2014 16:01:11 +1100 Subject: powerpc: Add _GLOBAL_TOC for ABIv2 assembly functions exported to modules If an assembly function that calls back into c code is exported to modules, we need to ensure r2 is setup correctly. There are only two places crazy enough to do it (two of which are my fault). Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/ppc_asm.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'arch/powerpc/include/asm/ppc_asm.h') diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 2cc2511ff076..6400f1814fe8 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -207,6 +207,16 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) .globl name; \ name: +#define _GLOBAL_TOC(name) \ + .section ".text"; \ + .align 2 ; \ + .type name,@function; \ + .globl name; \ +name: \ +0: addis r2,r12,(.TOC.-0b)@ha; \ + addi r2,r2,(.TOC.-0b)@l; \ + .localentry name,.-name + #define _KPROBE(name) \ .section ".kprobes.text","a"; \ .align 2 ; \ @@ -235,6 +245,8 @@ name: \ .type GLUE(.,name),@function; \ GLUE(.,name): +#define _GLOBAL_TOC(name) _GLOBAL(name) + #define _KPROBE(name) \ .section ".kprobes.text","a"; \ .align 2 ; \ -- cgit v1.2.3