]> git.hungrycats.org Git - linux/commit
ARM: 9419/1: mm: Fix kernel memory mapping for xip kernels
authorHarith G <harith.g@alifsemi.com>
Wed, 18 Sep 2024 05:57:11 +0000 (06:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Nov 2024 14:37:30 +0000 (15:37 +0100)
commit609641e959ee6ed86369f6ac08c56f66547587b7
tree25c04482d61743cad686cdd58c5d86697917c3a3
parentae35fcddd3ddca9959fc8c487fae59f9f8714c15
ARM: 9419/1: mm: Fix kernel memory mapping for xip kernels

[ Upstream commit ed6cbe6e5563452f305e89c15846820f2874e431 ]

The patchset introducing kernel_sec_start/end variables to separate the
kernel/lowmem memory mappings, broke the mapping of the kernel memory
for xipkernels.

kernel_sec_start/end variables are in RO area before the MMU is switched
on for xipkernels.
So these cannot be set early in boot in head.S. Fix this by setting these
after MMU is switched on.
xipkernels need two different mappings for kernel text (starting at
CONFIG_XIP_PHYS_ADDR) and data (starting at CONFIG_PHYS_OFFSET).
Also, move the kernel code mapping from devicemaps_init() to map_kernel().

Fixes: a91da5457085 ("ARM: 9089/1: Define kernel physical section start and end")
Signed-off-by: Harith George <harith.g@alifsemi.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/kernel/head.S
arch/arm/mm/mmu.c