Skip to content

Commit 98bf2d3

Browse files
chleroympe
authored andcommitted
powerpc/32s: Fix RTAS machine check with VMAP stack
When we have VMAP stack, exception prolog 1 sets r1, not r11. When it is not an RTAS machine check, don't trash r1 because it is needed by prolog 1. Fixes: da7bb43 ("powerpc/32: Fix vmap stack - Properly set r1 before activating MMU") Fixes: d2e0060 ("powerpc/32: Use SPRN_SPRG_SCRATCH2 in exception prologs") Cc: [email protected] # v5.10+ Signed-off-by: Christophe Leroy <[email protected]> [mpe: Squash in fixup for RTAS machine check from Christophe] Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/bc77d61d1c18940e456a2dee464f1e2eda65a3f0.1608621048.git.christophe.leroy@csgroup.eu
1 parent e71ba94 commit 98bf2d3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/powerpc/kernel/head_book3s_32.S

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,19 @@ __secondary_hold_acknowledge:
260260
MachineCheck:
261261
EXCEPTION_PROLOG_0
262262
#ifdef CONFIG_PPC_CHRP
263+
#ifdef CONFIG_VMAP_STACK
264+
mtspr SPRN_SPRG_SCRATCH2,r1
265+
mfspr r1, SPRN_SPRG_THREAD
266+
lwz r1, RTAS_SP(r1)
267+
cmpwi cr1, r1, 0
268+
bne cr1, 7f
269+
mfspr r1, SPRN_SPRG_SCRATCH2
270+
#else
263271
mfspr r11, SPRN_SPRG_THREAD
264272
lwz r11, RTAS_SP(r11)
265273
cmpwi cr1, r11, 0
266274
bne cr1, 7f
275+
#endif
267276
#endif /* CONFIG_PPC_CHRP */
268277
EXCEPTION_PROLOG_1 for_rtas=1
269278
7: EXCEPTION_PROLOG_2

0 commit comments

Comments
 (0)