[PATCH v1 15/15] powerpc/32: Use r11 to store DSISR in prolog

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


We now have r11 available. Use it to avoid reloading DSISR
from the stack when needed.

Signed-off-by: Christophe Leroy <christophe.leroy at csgroup.eu>
---
 arch/powerpc/kernel/head_6xx_8xx.h   | 4 ++--
 arch/powerpc/kernel/head_8xx.S       | 3 +--
 arch/powerpc/kernel/head_book3s_32.S | 3 +--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/head_6xx_8xx.h b/arch/powerpc/kernel/head_6xx_8xx.h
index 5a90bafee536..7116162dae9d 100644
--- a/arch/powerpc/kernel/head_6xx_8xx.h
+++ b/arch/powerpc/kernel/head_6xx_8xx.h
@@ -72,9 +72,9 @@
 	tovirt(r12, r12)
 	.if	\handle_dar_dsisr
 	lwz	r10, DAR(r12)
+	lwz	r11, DSISR(r12)
 	stw	r10, _DAR(r1)
-	lwz	r10, DSISR(r12)
-	stw	r10, _DSISR(r1)
+	stw	r11, _DSISR(r1)
 	.endif
 	lwz	r9, SRR1(r12)
 	lwz	r12, SRR0(r12)
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 7a078b26d24c..7e9cbd64efd9 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -335,9 +335,8 @@ DARFixed:/* Return from dcbx instruction bug workaround */
 	mtspr	SPRN_DAR, r11	/* Tag DAR, to be used in DTLB Error */
 	EXCEPTION_PROLOG_1
 	EXCEPTION_PROLOG_2 handle_dar_dsisr=1
+	andis.	r10,r11,DSISR_NOHPTE at h
 	lwz	r4, _DAR(r1)
-	lwz	r5, _DSISR(r1)
-	andis.	r10,r5,DSISR_NOHPTE at h
 	beq+	.Ldtlbie
 	tlbie	r4
 .Ldtlbie:
diff --git a/arch/powerpc/kernel/head_book3s_32.S b/arch/powerpc/kernel/head_book3s_32.S
index 40ee63af84f2..c0db295734f5 100644
--- a/arch/powerpc/kernel/head_book3s_32.S
+++ b/arch/powerpc/kernel/head_book3s_32.S
@@ -653,8 +653,7 @@ alignment_exception_tramp:
 
 handle_page_fault_tramp_1:
 	EXCEPTION_PROLOG_2 handle_dar_dsisr=1
-	lwz	r5, _DSISR(r1)
-	andis.	r0, r5, DSISR_DABRMATCH at h
+	andis.	r0, r11, DSISR_DABRMATCH at h
 	bne-	1f
 	EXC_XFER_LITE(0x300, handle_page_fault)
 1:	EXC_XFER_STD(0x300, do_break)
-- 
2.25.0



More information about the Linuxppc-dev mailing list