]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: return more carefully from sreset NMI
authorNicholas Piggin <npiggin@gmail.com>
Mon, 26 Mar 2018 15:01:03 +0000 (01:01 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 31 Mar 2018 13:47:45 +0000 (00:47 +1100)
commit6fdec8b435a79bfae8c7a95c154c350d050b3f6d
tree0d8b46aedcc3ab85da18ee89c77b32defcd5114d
parent3109f6cb1152c5979ad4db7a58c501ca36b73462
powerpc/64s: return more carefully from sreset NMI

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 <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/exceptions-64s.S