diff options
author | Russell Currey <ruscur@russell.cc> | 2019-03-27 14:35:54 +1100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-31 06:47:25 -0700 |
commit | a66c556e489caef02a3c63489b84a1687c6c0e66 (patch) | |
tree | 0ea6f815b39234454491913c091241813cf3ac04 /arch/powerpc/kernel | |
parent | 667890535fc5990320cb91961bbf7c97a6ed17f8 (diff) | |
download | linux-stable-a66c556e489caef02a3c63489b84a1687c6c0e66.tar.gz linux-stable-a66c556e489caef02a3c63489b84a1687c6c0e66.tar.bz2 linux-stable-a66c556e489caef02a3c63489b84a1687c6c0e66.zip |
powerpc/64: Fix booting large kernels with STRICT_KERNEL_RWX
[ Upstream commit 56c46bba9bbfe229b4472a5be313c44c5b714a39 ]
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: 1e0fc9d1eb2b ("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>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/head_64.S | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index ff8511d6d8ea..4f2e18266e34 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S @@ -961,7 +961,9 @@ start_here_multiplatform: /* Restore parameters passed from prom_init/kexec */ mr r3,r31 - bl early_setup /* also sets r13 and SPRG_PACA */ + LOAD_REG_ADDR(r12, DOTSYM(early_setup)) + mtctr r12 + bctrl /* also sets r13 and SPRG_PACA */ LOAD_REG_ADDR(r3, start_here_common) ld r4,PACAKMSR(r13) |