powerpc/traps: fix recoverability of machine check handling on book3s/32
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 22 Jan 2019 14:11:24 +0000 (14:11 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 21 Feb 2019 13:10:16 +0000 (00:10 +1100)
Looks like book3s/32 doesn't set RI on machine check, so
checking RI before calling die() will always be fatal
allthought this is not an issue in most cases.

Fixes: b96672dd840f ("powerpc: Machine check interrupt is a non-maskable interrupt")
Fixes: daf00ae71dad ("powerpc/traps: restore recoverability of machine_check interrupts")
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: stable@vger.kernel.org
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/traps.c

index 040b602936132ecf10bed914dcb428669f90a9bc..b25bc8af7d38400d7b123eaabe794f47e16393d9 100644 (file)
@@ -756,15 +756,15 @@ void machine_check_exception(struct pt_regs *regs)
        if (check_io_access(regs))
                goto bail;
 
-       /* Must die if the interrupt is not recoverable */
-       if (!(regs->msr & MSR_RI))
-               nmi_panic(regs, "Unrecoverable Machine check");
-
        if (!nested)
                nmi_exit();
 
        die("Machine check", regs, SIGBUS);
 
+       /* Must die if the interrupt is not recoverable */
+       if (!(regs->msr & MSR_RI))
+               nmi_panic(regs, "Unrecoverable Machine check");
+
        return;
 
 bail: