Skip to content

Commit 8d0e210

Browse files
Ganesh Goudarmpe
authored andcommitted
powerpc/mce: Avoid nmi_enter/exit in real mode on pseries hash
Use of nmi_enter/exit in real mode handler causes the kernel to panic and reboot on injecting SLB mutihit on pseries machine running in hash MMU mode, because these calls try to accesses memory outside RMO region in real mode handler where translation is disabled. Add check to not to use these calls on pseries machine running in hash MMU mode. Fixes: 116ac37 ("powerpc/64s: machine check interrupt update NMI accounting") Cc: stable@vger.kernel.org # v5.8+ Signed-off-by: Ganesh Goudar <ganeshgr@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20201009064005.19777-2-ganeshgr@linux.ibm.com
1 parent d4263b1 commit 8d0e210

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

arch/powerpc/kernel/mce.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,12 +591,11 @@ EXPORT_SYMBOL_GPL(machine_check_print_event_info);
591591
long notrace machine_check_early(struct pt_regs *regs)
592592
{
593593
long handled = 0;
594-
bool nested = in_nmi();
595594
u8 ftrace_enabled = this_cpu_get_ftrace_enabled();
596595

597596
this_cpu_set_ftrace_enabled(0);
598-
599-
if (!nested)
597+
/* Do not use nmi_enter/exit for pseries hpte guest */
598+
if (radix_enabled() || !firmware_has_feature(FW_FEATURE_LPAR))
600599
nmi_enter();
601600

602601
hv_nmi_check_nonrecoverable(regs);
@@ -607,7 +606,7 @@ long notrace machine_check_early(struct pt_regs *regs)
607606
if (ppc_md.machine_check_early)
608607
handled = ppc_md.machine_check_early(regs);
609608

610-
if (!nested)
609+
if (radix_enabled() || !firmware_has_feature(FW_FEATURE_LPAR))
611610
nmi_exit();
612611

613612
this_cpu_set_ftrace_enabled(ftrace_enabled);

0 commit comments

Comments
 (0)