aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/lib/copypage_power7.S
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2014-02-14 13:21:03 -0500
committerAnton Blanchard <anton@samba.org>2014-04-22 20:05:24 -0400
commit752a6422fec3c0f5f9d4ac43d92f5dd13e22fde4 (patch)
tree6ef91c1ad3c067345ce45bb6d7730ab9f38c9241 /arch/powerpc/lib/copypage_power7.S
parentb37c10d128a2fa3256d4e67c184177270eac4b86 (diff)
powerpc: Fix unsafe accesses to parameter area in ELFv2
Some of the assembler files in lib/ make use of the fact that in the ELFv1 ABI, the caller guarantees to provide stack space to save the parameter registers r3 ... r10. This guarantee is no longer present in ELFv2 for functions that have no variable argument list and no more than 8 arguments. Change the affected routines to temporarily store registers in the red zone and/or the top of their own stack frame (in the space provided to save r31 .. r29, which is actually not used in these routines). In opal_query_takeover, simply always allocate a stack frame; the routine is not performance critical. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com> Signed-off-by: Anton Blanchard <anton@samba.org>
Diffstat (limited to 'arch/powerpc/lib/copypage_power7.S')
-rw-r--r--arch/powerpc/lib/copypage_power7.S8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/lib/copypage_power7.S b/arch/powerpc/lib/copypage_power7.S
index affc6d308e13..d7dafb3777ac 100644
--- a/arch/powerpc/lib/copypage_power7.S
+++ b/arch/powerpc/lib/copypage_power7.S
@@ -56,15 +56,15 @@ _GLOBAL(copypage_power7)
56 56
57#ifdef CONFIG_ALTIVEC 57#ifdef CONFIG_ALTIVEC
58 mflr r0 58 mflr r0
59 std r3,STK_PARAM(R3)(r1) 59 std r3,-STACKFRAMESIZE+STK_REG(R31)(r1)
60 std r4,STK_PARAM(R4)(r1) 60 std r4,-STACKFRAMESIZE+STK_REG(R30)(r1)
61 std r0,16(r1) 61 std r0,16(r1)
62 stdu r1,-STACKFRAMESIZE(r1) 62 stdu r1,-STACKFRAMESIZE(r1)
63 bl enter_vmx_copy 63 bl enter_vmx_copy
64 cmpwi r3,0 64 cmpwi r3,0
65 ld r0,STACKFRAMESIZE+16(r1) 65 ld r0,STACKFRAMESIZE+16(r1)
66 ld r3,STACKFRAMESIZE+STK_PARAM(R3)(r1) 66 ld r3,STK_REG(R31)(r1)
67 ld r4,STACKFRAMESIZE+STK_PARAM(R4)(r1) 67 ld r4,STK_REG(R30)(r1)
68 mtlr r0 68 mtlr r0
69 69
70 li r0,(PAGE_SIZE/128) 70 li r0,(PAGE_SIZE/128)