Re: [PATCH 1/2] arm: mm: Fix kernel memory mapping for xip kernels

From: Linus Walleij
Date: Fri Aug 23 2024 - 11:42:23 EST


On Wed, Jul 31, 2024 at 1:39 PM Harith George <mail2hgg@xxxxxxxxx> wrote:

> From: Harith George <harith.g@xxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxx>

Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
(also for patch 2/2)

Sorry for breaking XIP :(

Can you put these patches into Russell's patch tracker so he
can track it?
https://www.armlinux.org.uk/developer/patches/

Yours,
Linus Walleij