Skip to content

Commit e13e7cd

Browse files
npigginmpe
authored andcommitted
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: 890274c ("powerpc/64s: Implement KUAP for Radix MMU") Cc: Russell Currey <[email protected]> Signed-off-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 5008711 commit e13e7cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kernel/exceptions-64s.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ TRAMP_REAL_BEGIN(machine_check_common_early)
315315
mfspr r11,SPRN_DSISR /* Save DSISR */
316316
std r11,_DSISR(r1)
317317
std r9,_CCR(r1) /* Save CR in stackframe */
318-
kuap_save_amr_and_lock r9, r10, cr1
318+
/* We don't touch AMR here, we never go to virtual mode */
319319
/* Save r9 through r13 from EXMC save area to stack frame. */
320320
EXCEPTION_PROLOG_COMMON_2(PACA_EXMC)
321321
mfmsr r11 /* get MSR value */

0 commit comments

Comments
 (0)