]> 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)
commit72b90b9f19cb1796676aadaa4801146f15864742
tree0d8b46aedcc3ab85da18ee89c77b32defcd5114d
parenta6c911ecf84353e92e09c781a859146cf9c83a5a
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