powerpc/64s: Fix i-side SLB miss bad address handler saving nonvolatile GPRs
authorNicholas Piggin <npiggin@gmail.com>
Fri, 23 Mar 2018 05:53:38 +0000 (15:53 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 25 Mar 2018 20:40:17 +0000 (07:40 +1100)
commit52396500f97c53860164debc7d4f759077853423
treed8d9b25014b85d24f6b2594ee742c4804f42e99b
parenta5d4b5891c2f1f865a2def1eb0030f534e77ff86
powerpc/64s: Fix i-side SLB miss bad address handler saving nonvolatile GPRs

The SLB bad address handler's trap number fixup does not preserve the
low bit that indicates nonvolatile GPRs have not been saved. This
leads save_nvgprs to skip saving them, and subsequent functions and
return from interrupt will think they are saved.

This causes kernel branch-to-garbage debugging to not have correct
registers, can also cause userspace to have its registers clobbered
after a segfault.

Fixes: f0f558b131db ("powerpc/mm: Preserve CFAR value on SLB miss caused by access to bogus address")
Cc: stable@vger.kernel.org # v4.9+
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/exceptions-64s.S