Skip to content

Commit b32e4cc

Browse files
npiggingregkh
authored andcommitted
powerpc/64s/exception: machine check use correct cfar for late handler
[ Upstream commit 0b66370 ] Bare metal machine checks run an "early" handler in real mode before running the main handler which reports the event. The main handler runs exactly as a normal interrupt handler, after the "windup" which sets registers back as they were at interrupt entry. CFAR does not get restored by the windup code, so that will be wrong when the handler is run. Restore the CFAR to the saved value before running the late handler. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190802105709.27696-8-npiggin@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f939cc0 commit b32e4cc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,10 @@ FTR_SECTION_ELSE
556556
ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE)
557557
9:
558558
/* Deliver the machine check to host kernel in V mode. */
559+
BEGIN_FTR_SECTION
560+
ld r10,ORIG_GPR3(r1)
561+
mtspr SPRN_CFAR,r10
562+
END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
559563
MACHINE_CHECK_HANDLER_WINDUP
560564
SET_SCRATCH0(r13) /* save r13 */
561565
EXCEPTION_PROLOG_0(PACA_EXMC)

0 commit comments

Comments
 (0)