@@ -250,12 +250,21 @@ BEGIN_FTR_SECTION
END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
ld r13,GPR13(r1) /* only restore r13 if returning to usermode */
-1: ld r2,GPR2(r1)
+1:
+ mfspr r11,SPRN_SRR0
+ mfspr r12,SPRN_SRR1
+ cmpld r7,r11
+ beq 5f
+ mtspr SPRN_SRR0,r7
+5:
+ cmpld r8,r12
+ beq 6f
+ mtspr SPRN_SRR1,r8
+6:
+ ld r2,GPR2(r1)
ld r1,GPR1(r1)
mtlr r4
mtcr r5
- mtspr SPRN_SRR0,r7
- mtspr SPRN_SRR1,r8
RFI
b . /* prevent speculative execution */
@@ -859,12 +868,21 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
ACCOUNT_CPU_USER_EXIT(r13, r2, r4)
REST_GPR(13, r1)
1:
+ mfspr r0,SPRN_SRR0
+ mfspr r2,SPRN_SRR1
+ ld r4,_NIP(r1)
+
+ cmpld r0,r4
+ beq 5f
+ mtspr SPRN_SRR0,r4
+5:
+ cmpld r2,r3
+ beq 6f
mtspr SPRN_SRR1,r3
+6:
ld r2,_CCR(r1)
mtcrf 0xFF,r2
- ld r2,_NIP(r1)
- mtspr SPRN_SRR0,r2
ld r0,GPR0(r1)
ld r2,GPR2(r1)