Skip to contentSkip to conversation

powerpc/32: Remove redundant test in transfer_to_handler()

PATCH In review Christophe Leroy 1 participant 2 messages Apr 14, 2017 – Apr 18, 2017 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/32: Remove redundant test in transfer_to_handler()

As stated in the comment on top of transfer_to_handler(), all callers set cr0.eq if the exception occurred in kernel mode (i.e. MSR:PR = 0)

Therefore, it is not needed to do the test again

---
 arch/powerpc/kernel/entry_32.S | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/kernel/entry_32.S +0 -1
index a38600949f3a..0651a7438fa6 100644
@@ -141,7 +141,6 @@ transfer_to_handler:
 	stw	r2,GPR2(r11)
 	stw	r12,_NIP(r11)
 	stw	r9,_MSR(r11)
-	andi.	r2,r9,MSR_PR
 	mfctr	r12
 	mfspr	r2,SPRN_XER
 	stw	r12,_CTR(r11)
Signature · 1 line
2.12.0
#1 lore raw
Quoted 5 lines · Christophe Leroy

As stated in the comment on top of transfer_to_handler(), all callers set cr0.eq if the exception occurred in kernel mode (i.e. MSR:PR = 0)

Therefore, it is not needed to do the test again

Indeed, all callers set cr0.eq as required .... except that some of them just destroy it by inserting another test before calling transfer_to_handler().

So this patch cannot be applied as is at the time being.

Christophe

Quoted 19 lines
---
 arch/powerpc/kernel/entry_32.S | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/kernel/entry_32.S +0 -1
index a38600949f3a..0651a7438fa6 100644
@@ -141,7 +141,6 @@ transfer_to_handler:
 	stw	r2,GPR2(r11)
 	stw	r12,_NIP(r11)
 	stw	r9,_MSR(r11)
-	andi.	r2,r9,MSR_PR
 	mfctr	r12
 	mfspr	r2,SPRN_XER
 	stw	r12,_CTR(r11)