Skip to content

Commit 477f348

Browse files
chleroympe
authored andcommitted
powerpc/6xx: Fix power_save_ppc32_restore() with CONFIG_VMAP_STACK
power_save_ppc32_restore() is called during exception entry, before re-enabling the MMU. It substracts KERNELBASE from the address of nap_save_msscr0 to access it. With CONFIG_VMAP_STACK enabled, data MMU translation has already been re-enabled, so power_save_ppc32_restore() has to access nap_save_msscr0 by its virtual address. Reported-by: Larry Finger <[email protected]> Signed-off-by: Christophe Leroy <[email protected]> Fixes: cd08f10 ("powerpc/32s: Enable CONFIG_VMAP_STACK") Tested-by: Larry Finger <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/7bce32ccbab3ba3e3e0f27da6961bf6313df97ed.1581663140.git.christophe.leroy@c-s.fr
1 parent 5a528eb commit 477f348

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arch/powerpc/kernel/idle_6xx.S

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,23 @@ BEGIN_FTR_SECTION
166166
mfspr r9,SPRN_HID0
167167
andis. r9,r9,HID0_NAP@h
168168
beq 1f
169+
#ifdef CONFIG_VMAP_STACK
170+
addis r9, r11, nap_save_msscr0@ha
171+
#else
169172
addis r9,r11,(nap_save_msscr0-KERNELBASE)@ha
173+
#endif
170174
lwz r9,nap_save_msscr0@l(r9)
171175
mtspr SPRN_MSSCR0, r9
172176
sync
173177
isync
174178
1:
175179
END_FTR_SECTION_IFSET(CPU_FTR_NAP_DISABLE_L2_PR)
176180
BEGIN_FTR_SECTION
181+
#ifdef CONFIG_VMAP_STACK
182+
addis r9, r11, nap_save_hid1@ha
183+
#else
177184
addis r9,r11,(nap_save_hid1-KERNELBASE)@ha
185+
#endif
178186
lwz r9,nap_save_hid1@l(r9)
179187
mtspr SPRN_HID1, r9
180188
END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX)

0 commit comments

Comments
 (0)