diff options
| -rw-r--r-- | arch/powerpc/kernel/exceptions-64s.S | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 20f11eb4dff7..274a86d001c7 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
| @@ -1389,6 +1389,7 @@ machine_check_handle_early: | |||
| 1389 | bl save_nvgprs | 1389 | bl save_nvgprs |
| 1390 | addi r3,r1,STACK_FRAME_OVERHEAD | 1390 | addi r3,r1,STACK_FRAME_OVERHEAD |
| 1391 | bl machine_check_early | 1391 | bl machine_check_early |
| 1392 | std r3,RESULT(r1) /* Save result */ | ||
| 1392 | ld r12,_MSR(r1) | 1393 | ld r12,_MSR(r1) |
| 1393 | #ifdef CONFIG_PPC_P7_NAP | 1394 | #ifdef CONFIG_PPC_P7_NAP |
| 1394 | /* | 1395 | /* |
| @@ -1443,11 +1444,33 @@ machine_check_handle_early: | |||
| 1443 | */ | 1444 | */ |
| 1444 | andi. r11,r12,MSR_RI | 1445 | andi. r11,r12,MSR_RI |
| 1445 | bne 2f | 1446 | bne 2f |
| 1446 | 1: addi r3,r1,STACK_FRAME_OVERHEAD | 1447 | 1: mfspr r11,SPRN_SRR0 |
| 1447 | bl unrecoverable_exception | 1448 | ld r10,PACAKBASE(r13) |
| 1448 | b 1b | 1449 | LOAD_HANDLER(r10,unrecover_mce) |
| 1450 | mtspr SPRN_SRR0,r10 | ||
| 1451 | ld r10,PACAKMSR(r13) | ||
| 1452 | /* | ||
| 1453 | * We are going down. But there are chances that we might get hit by | ||
| 1454 | * another MCE during panic path and we may run into unstable state | ||
| 1455 | * with no way out. Hence, turn ME bit off while going down, so that | ||
| 1456 | * when another MCE is hit during panic path, system will checkstop | ||
| 1457 | * and hypervisor will get restarted cleanly by SP. | ||
| 1458 | */ | ||
| 1459 | li r3,MSR_ME | ||
| 1460 | andc r10,r10,r3 /* Turn off MSR_ME */ | ||
| 1461 | mtspr SPRN_SRR1,r10 | ||
| 1462 | rfid | ||
| 1463 | b . | ||
| 1449 | 2: | 1464 | 2: |
| 1450 | /* | 1465 | /* |
| 1466 | * Check if we have successfully handled/recovered from error, if not | ||
| 1467 | * then stay on emergency stack and panic. | ||
| 1468 | */ | ||
| 1469 | ld r3,RESULT(r1) /* Load result */ | ||
| 1470 | cmpdi r3,0 /* see if we handled MCE successfully */ | ||
| 1471 | |||
| 1472 | beq 1b /* if !handled then panic */ | ||
| 1473 | /* | ||
| 1451 | * Return from MC interrupt. | 1474 | * Return from MC interrupt. |
| 1452 | * Queue up the MCE event so that we can log it later, while | 1475 | * Queue up the MCE event so that we can log it later, while |
| 1453 | * returning from kernel or opal call. | 1476 | * returning from kernel or opal call. |
| @@ -1460,6 +1483,17 @@ machine_check_handle_early: | |||
| 1460 | MACHINE_CHECK_HANDLER_WINDUP | 1483 | MACHINE_CHECK_HANDLER_WINDUP |
| 1461 | b machine_check_pSeries | 1484 | b machine_check_pSeries |
| 1462 | 1485 | ||
| 1486 | unrecover_mce: | ||
| 1487 | /* Invoke machine_check_exception to print MCE event and panic. */ | ||
| 1488 | addi r3,r1,STACK_FRAME_OVERHEAD | ||
| 1489 | bl .machine_check_exception | ||
| 1490 | /* | ||
| 1491 | * We will not reach here. Even if we did, there is no way out. Call | ||
| 1492 | * unrecoverable_exception and die. | ||
| 1493 | */ | ||
| 1494 | 1: addi r3,r1,STACK_FRAME_OVERHEAD | ||
| 1495 | bl .unrecoverable_exception | ||
| 1496 | b 1b | ||
| 1463 | /* | 1497 | /* |
| 1464 | * r13 points to the PACA, r9 contains the saved CR, | 1498 | * r13 points to the PACA, r9 contains the saved CR, |
| 1465 | * r12 contain the saved SRR1, SRR0 is still ready for return | 1499 | * r12 contain the saved SRR1, SRR0 is still ready for return |
