File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -485,7 +485,23 @@ machine_check_fwnmi:
485
485
EXCEPTION_PROLOG_0(PACA_EXMC)
486
486
machine_check_pSeries_0:
487
487
EXCEPTION_PROLOG_1(PACA_EXMC, KVMTEST, 0x200 )
488
- EXCEPTION_PROLOG_PSERIES_1(machine_check_common, EXC_STD)
488
+ /*
489
+ * The following is essentially EXCEPTION_PROLOG_PSERIES_1 with the
490
+ * difference that MSR_RI is not enabled, because PACA_EXMC is being
491
+ * used, so nested machine check corrupts it. machine_check_common
492
+ * enables MSR_RI.
493
+ */
494
+ ld r12,PACAKBASE(r13)
495
+ ld r10,PACAKMSR(r13)
496
+ xori r10,r10,MSR_RI
497
+ mfspr r11,SPRN_SRR0
498
+ LOAD_HANDLER(r12, machine_check_common)
499
+ mtspr SPRN_SRR0,r12
500
+ mfspr r12,SPRN_SRR1
501
+ mtspr SPRN_SRR1,r10
502
+ rfid
503
+ b . /* prevent speculative execution */
504
+
489
505
KVM_HANDLER_SKIP(PACA_EXMC, EXC_STD, 0x200 )
490
506
KVM_HANDLER_SKIP(PACA_EXGEN, EXC_STD, 0x300 )
491
507
KVM_HANDLER_SKIP(PACA_EXSLB, EXC_STD, 0x380 )
@@ -977,6 +993,9 @@ machine_check_common:
977
993
RECONCILE_IRQ_STATE(r10, r11)
978
994
ld r3,PACA_EXMC+EX_DAR(r13)
979
995
lwz r4,PACA_EXMC+EX_DSISR(r13)
996
+ /* Enable MSR_RI when finished with PACA_EXMC */
997
+ li r10,MSR_RI
998
+ mtmsrd r10,1
980
999
std r3,_DAR(r1)
981
1000
std r4,_DSISR(r1)
982
1001
bl save_nvgprs
You can’t perform that action at this time.
0 commit comments