[PATCH v1 11/15] powerpc/32: Use r1 directly instead of r11 in syscall prolog

Christophe Leroy christophe.leroy at csgroup.eu
Wed Dec 23 00:28:33 AEDT 2020


In syscall prolog, we don't need to keep the stack pointer in r11 as
we do in exception prolog. So r1 can be used directly to free r11.

Signed-off-by: Christophe Leroy <christophe.leroy at csgroup.eu>
---
 arch/powerpc/kernel/head_6xx_8xx.h | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/kernel/head_6xx_8xx.h b/arch/powerpc/kernel/head_6xx_8xx.h
index 540092fb90a9..2536f0a660af 100644
--- a/arch/powerpc/kernel/head_6xx_8xx.h
+++ b/arch/powerpc/kernel/head_6xx_8xx.h
@@ -101,26 +101,25 @@
 	tovirt(r12, r12)
 	stw	r11,GPR1(r1)
 	stw	r11,0(r1)
-	mr	r11, r1
 	mflr	r10
-	stw	r10, _LINK(r11)
+	stw	r10, _LINK(r1)
 	mfctr	r10
-	stw	r10,_NIP(r11)
+	stw	r10,_NIP(r1)
 	mfcr	r10
 	rlwinm	r10,r10,0,4,2	/* Clear SO bit in CR */
-	stw	r10,_CCR(r11)		/* save registers */
+	stw	r10,_CCR(r1)		/* save registers */
 	LOAD_REG_IMMEDIATE(r10, MSR_KERNEL & ~MSR_IR) /* can take exceptions */
 	mtmsr	r10			/* (except for mach check in rtas) */
 	lis	r10,STACK_FRAME_REGS_MARKER at ha /* exception frame marker */
-	stw	r2,GPR2(r11)
+	stw	r2,GPR2(r1)
 	addi	r10,r10,STACK_FRAME_REGS_MARKER at l
-	stw	r9,_MSR(r11)
+	stw	r9,_MSR(r1)
 	li	r2, \trapno + 1
-	stw	r10,8(r11)
-	stw	r2,_TRAP(r11)
-	SAVE_GPR(0, r11)
-	SAVE_4GPRS(3, r11)
-	SAVE_2GPRS(7, r11)
+	stw	r10,8(r1)
+	stw	r2,_TRAP(r1)
+	SAVE_GPR(0, r1)
+	SAVE_4GPRS(3, r1)
+	SAVE_2GPRS(7, r1)
 	addi	r11,r1,STACK_FRAME_OVERHEAD
 	addi	r2,r12,-THREAD
 	stw	r11,PT_REGS(r12)
-- 
2.25.0



More information about the Linuxppc-dev mailing list