Skip to content

Commit ee07935

Browse files
ruscurgregkh
authored andcommitted
powerpc/64: Fix booting large kernels with STRICT_KERNEL_RWX
[ Upstream commit 56c46bb ] With STRICT_KERNEL_RWX enabled anything marked __init is placed at a 16M boundary. This is necessary so that it can be repurposed later with different permissions. However, in kernels with text larger than 16M, this pushes early_setup past 32M, incapable of being reached by the branch instruction. Fix this by setting the CTR and branching there instead. Fixes: 1e0fc9d ("powerpc/Kconfig: Enable STRICT_KERNEL_RWX for some configs") Signed-off-by: Russell Currey <ruscur@russell.cc> [mpe: Fix it to work on BE by using DOTSYM()] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c4fb49c commit ee07935

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎arch/powerpc/kernel/head_64.S‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,9 @@ start_here_multiplatform:
968968

969969
/* Restore parameters passed from prom_init/kexec */
970970
mr r3,r31
971-
bl early_setup /* also sets r13 and SPRG_PACA */
971+
LOAD_REG_ADDR(r12, DOTSYM(early_setup))
972+
mtctr r12
973+
bctrl /* also sets r13 and SPRG_PACA */
972974

973975
LOAD_REG_ADDR(r3, start_here_common)
974976
ld r4,PACAKMSR(r13)

0 commit comments

Comments
 (0)