Subject: Re: powerpc/64s: return more carefully from sreset NMI

From: Michael Ellerman <[email-masked]>
Date: Wed, 4 Apr 2018 02:03:40 +1000 (AEST)

On Mon, 2018-03-26 at 15:01:03 UTC, Nicholas Piggin wrote:
> System Reset, being an NMI, must return more carefully than other
> interrupts. It has traditionally returned via the nromal return
> from exception path, but that has a number of problems.
> 
> - r13 does not get restored if returning to kernel. This is for
>   interrupts which may cause a context switch, which sreset will
>   never do. Interrupting OPAL (which uses a different r13) is one
>   place where this causes breakage.
> 
> - It may cause several other problems returning to kernel with
>   preempt or TIF_EMULATE_STACK_STORE if it hits at the wrong time.
> 
> It's safer just to have a simple restore and return, like machine
> check which is the other NMI.
> 
> Signed-off-by: Nicholas Piggin <[email-masked]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/15b4dd7981496f51c5f9262a5e0761

cheers