diff options
Diffstat (limited to 'arch/powerpc/kernel/exceptions-64s.S')
-rw-r--r-- | arch/powerpc/kernel/exceptions-64s.S | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 72e783ea0681..db08382e19f1 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
@@ -131,6 +131,8 @@ BEGIN_FTR_SECTION | |||
131 | 1: | 131 | 1: |
132 | #endif | 132 | #endif |
133 | 133 | ||
134 | /* Return SRR1 from power7_nap() */ | ||
135 | mfspr r3,SPRN_SRR1 | ||
134 | beq cr1,2f | 136 | beq cr1,2f |
135 | b power7_wakeup_noloss | 137 | b power7_wakeup_noloss |
136 | 2: b power7_wakeup_loss | 138 | 2: b power7_wakeup_loss |
@@ -292,15 +294,26 @@ decrementer_pSeries: | |||
292 | . = 0xc00 | 294 | . = 0xc00 |
293 | .globl system_call_pSeries | 295 | .globl system_call_pSeries |
294 | system_call_pSeries: | 296 | system_call_pSeries: |
295 | HMT_MEDIUM | 297 | /* |
298 | * If CONFIG_KVM_BOOK3S_64_HANDLER is set, save the PPR (on systems | ||
299 | * that support it) before changing to HMT_MEDIUM. That allows the KVM | ||
300 | * code to save that value into the guest state (it is the guest's PPR | ||
301 | * value). Otherwise just change to HMT_MEDIUM as userspace has | ||
302 | * already saved the PPR. | ||
303 | */ | ||
296 | #ifdef CONFIG_KVM_BOOK3S_64_HANDLER | 304 | #ifdef CONFIG_KVM_BOOK3S_64_HANDLER |
297 | SET_SCRATCH0(r13) | 305 | SET_SCRATCH0(r13) |
298 | GET_PACA(r13) | 306 | GET_PACA(r13) |
299 | std r9,PACA_EXGEN+EX_R9(r13) | 307 | std r9,PACA_EXGEN+EX_R9(r13) |
308 | OPT_GET_SPR(r9, SPRN_PPR, CPU_FTR_HAS_PPR); | ||
309 | HMT_MEDIUM; | ||
300 | std r10,PACA_EXGEN+EX_R10(r13) | 310 | std r10,PACA_EXGEN+EX_R10(r13) |
311 | OPT_SAVE_REG_TO_PACA(PACA_EXGEN+EX_PPR, r9, CPU_FTR_HAS_PPR); | ||
301 | mfcr r9 | 312 | mfcr r9 |
302 | KVMTEST(0xc00) | 313 | KVMTEST(0xc00) |
303 | GET_SCRATCH0(r13) | 314 | GET_SCRATCH0(r13) |
315 | #else | ||
316 | HMT_MEDIUM; | ||
304 | #endif | 317 | #endif |
305 | SYSCALL_PSERIES_1 | 318 | SYSCALL_PSERIES_1 |
306 | SYSCALL_PSERIES_2_RFID | 319 | SYSCALL_PSERIES_2_RFID |
@@ -1301,23 +1314,6 @@ hmi_exception_after_realmode: | |||
1301 | EXCEPTION_PROLOG_0(PACA_EXGEN) | 1314 | EXCEPTION_PROLOG_0(PACA_EXGEN) |
1302 | b hmi_exception_hv | 1315 | b hmi_exception_hv |
1303 | 1316 | ||
1304 | #ifdef CONFIG_PPC_POWERNV | ||
1305 | _GLOBAL(opal_mc_secondary_handler) | ||
1306 | HMT_MEDIUM_PPR_DISCARD | ||
1307 | SET_SCRATCH0(r13) | ||
1308 | GET_PACA(r13) | ||
1309 | clrldi r3,r3,2 | ||
1310 | tovirt(r3,r3) | ||
1311 | std r3,PACA_OPAL_MC_EVT(r13) | ||
1312 | ld r13,OPAL_MC_SRR0(r3) | ||
1313 | mtspr SPRN_SRR0,r13 | ||
1314 | ld r13,OPAL_MC_SRR1(r3) | ||
1315 | mtspr SPRN_SRR1,r13 | ||
1316 | ld r3,OPAL_MC_GPR3(r3) | ||
1317 | GET_SCRATCH0(r13) | ||
1318 | b machine_check_pSeries | ||
1319 | #endif /* CONFIG_PPC_POWERNV */ | ||
1320 | |||
1321 | 1317 | ||
1322 | #define MACHINE_CHECK_HANDLER_WINDUP \ | 1318 | #define MACHINE_CHECK_HANDLER_WINDUP \ |
1323 | /* Clear MSR_RI before setting SRR0 and SRR1. */\ | 1319 | /* Clear MSR_RI before setting SRR0 and SRR1. */\ |
@@ -1571,9 +1567,11 @@ do_hash_page: | |||
1571 | * r3 contains the faulting address | 1567 | * r3 contains the faulting address |
1572 | * r4 contains the required access permissions | 1568 | * r4 contains the required access permissions |
1573 | * r5 contains the trap number | 1569 | * r5 contains the trap number |
1570 | * r6 contains dsisr | ||
1574 | * | 1571 | * |
1575 | * at return r3 = 0 for success, 1 for page fault, negative for error | 1572 | * at return r3 = 0 for success, 1 for page fault, negative for error |
1576 | */ | 1573 | */ |
1574 | ld r6,_DSISR(r1) | ||
1577 | bl hash_page /* build HPTE if possible */ | 1575 | bl hash_page /* build HPTE if possible */ |
1578 | cmpdi r3,0 /* see if hash_page succeeded */ | 1576 | cmpdi r3,0 /* see if hash_page succeeded */ |
1579 | 1577 | ||