diff options
-rw-r--r-- | arch/powerpc/include/asm/ppc_asm.h | 7 | ||||
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 10 |
2 files changed, 9 insertions, 8 deletions
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 8deaaad3b32f..3c1acc31a092 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h | |||
@@ -406,13 +406,6 @@ BEGIN_FTR_SECTION_NESTED(945) \ | |||
406 | std ra,TASKTHREADPPR(rb); \ | 406 | std ra,TASKTHREADPPR(rb); \ |
407 | END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,945) | 407 | END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,945) |
408 | 408 | ||
409 | #define RESTORE_PPR(ra, rb) \ | ||
410 | BEGIN_FTR_SECTION_NESTED(946) \ | ||
411 | ld ra,PACACURRENT(r13); \ | ||
412 | ld rb,TASKTHREADPPR(ra); \ | ||
413 | mtspr SPRN_PPR,rb; /* Restore PPR */ \ | ||
414 | END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,946) | ||
415 | |||
416 | #endif | 409 | #endif |
417 | 410 | ||
418 | /* | 411 | /* |
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 12679cd43e0c..bbfb0294b354 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -818,6 +818,12 @@ fast_exception_return: | |||
818 | andi. r0,r3,MSR_RI | 818 | andi. r0,r3,MSR_RI |
819 | beq- unrecov_restore | 819 | beq- unrecov_restore |
820 | 820 | ||
821 | /* Load PPR from thread struct before we clear MSR:RI */ | ||
822 | BEGIN_FTR_SECTION | ||
823 | ld r2,PACACURRENT(r13) | ||
824 | ld r2,TASKTHREADPPR(r2) | ||
825 | END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) | ||
826 | |||
821 | /* | 827 | /* |
822 | * Clear RI before restoring r13. If we are returning to | 828 | * Clear RI before restoring r13. If we are returning to |
823 | * userspace and we take an exception after restoring r13, | 829 | * userspace and we take an exception after restoring r13, |
@@ -838,8 +844,10 @@ fast_exception_return: | |||
838 | */ | 844 | */ |
839 | andi. r0,r3,MSR_PR | 845 | andi. r0,r3,MSR_PR |
840 | beq 1f | 846 | beq 1f |
847 | BEGIN_FTR_SECTION | ||
848 | mtspr SPRN_PPR,r2 /* Restore PPR */ | ||
849 | END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) | ||
841 | ACCOUNT_CPU_USER_EXIT(r2, r4) | 850 | ACCOUNT_CPU_USER_EXIT(r2, r4) |
842 | RESTORE_PPR(r2, r4) | ||
843 | REST_GPR(13, r1) | 851 | REST_GPR(13, r1) |
844 | 1: | 852 | 1: |
845 | mtspr SPRN_SRR1,r3 | 853 | mtspr SPRN_SRR1,r3 |