]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s/exception: Fix machine check early corrupting AMR
authorNicholas Piggin <npiggin@gmail.com>
Fri, 21 Jun 2019 22:55:54 +0000 (08:55 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 25 Jun 2019 11:04:27 +0000 (21:04 +1000)
commitffc39037ba3f20fd77c69568f5f846bf707e62db
tree53e402b7bf7325ff96c0fa655188722a47f97611
parent67f5ef9138544a6660206124c6e95f2a83d53994
powerpc/64s/exception: Fix machine check early corrupting AMR

The early machine check runs in real mode, so locking is unnecessary.
Worse, the windup does not restore AMR, so this can result in a false
KUAP fault after a recoverable machine check hits inside a user copy
operation.

Fix this similarly to HMI by just avoiding the kuap lock in the
early machine check handler (it will be set by the late handler that
runs in virtual mode if that runs). If the virtual mode handler is
reached, it will lock and restore the AMR.

Fixes: 297ceb88cc192 ("powerpc/64s: Implement KUAP for Radix MMU")
Cc: Russell Currey <ruscur@russell.cc>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/exceptions-64s.S