]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
powerpc: improve handling of unrecoverable system reset
authorNicholas Piggin <npiggin@gmail.com>
Sat, 30 Jan 2021 13:08:35 +0000 (23:08 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 15:43:46 +0000 (16:43 +0100)
[ Upstream commit 11cb0a25f71818ca7ab4856548ecfd83c169aa4d ]

If an unrecoverable system reset hits in process context, the system
does not have to panic. Similar to machine check, call nmi_exit()
before die().

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210130130852.2952424-26-npiggin@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kernel/traps.c

index 1b2d84cb373bb9d10b4b9c35fcae9b44e22513ad..2379c4bf3979ee69cbadfa16e76f6a0db0e951d3 100644 (file)
@@ -433,8 +433,11 @@ out:
                die("Unrecoverable nested System Reset", regs, SIGABRT);
 #endif
        /* Must die if the interrupt is not recoverable */
-       if (!(regs->msr & MSR_RI))
+       if (!(regs->msr & MSR_RI)) {
+               /* For the reason explained in die_mce, nmi_exit before die */
+               nmi_exit();
                die("Unrecoverable System Reset", regs, SIGABRT);
+       }
 
        if (!nested)
                nmi_exit();