]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc/64: Fix booting large kernels with STRICT_KERNEL_RWX
authorRussell Currey <ruscur@russell.cc>
Wed, 27 Mar 2019 03:35:54 +0000 (14:35 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:28 +0000 (06:43 -0700)
commitee079354fba85bda54b9c64f662b8cd16260fdf8
tree59526cd9f53a9d129c70703a60e6d9cc0b627d56
parentc4fb49c727050a488d113ad5acb46a1822c161f7
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>
arch/powerpc/kernel/head_64.S