[PATCH] ARM: mm: shrink permanent FDT mapping to avoid mismatched attributes

Ard Biesheuvel ardb at kernel.org
Mon Aug 15 07:35:32 PDT 2022


On Mon, 15 Aug 2022 at 16:29, Russell King (Oracle)
<linux at armlinux.org.uk> wrote:
>
> On Mon, Aug 15, 2022 at 04:10:27PM +0200, Ard Biesheuvel wrote:
> > diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
> > index a55a9038abc8..aeb83eb5d251 100644
> > --- a/arch/arm/include/asm/memory.h
> > +++ b/arch/arm/include/asm/memory.h
> > @@ -79,7 +79,6 @@
> >  #define XIP_VIRT_ADDR(physaddr)  (MODULES_VADDR + ((physaddr) & 0x000fffff))
> >
> >  #define FDT_FIXED_BASE               UL(0xff800000)
> > -#define FDT_FIXED_SIZE               (2 * SECTION_SIZE)
> >  #define FDT_VIRT_BASE(physbase)      ((void *)(FDT_FIXED_BASE | (physbase) % SECTION_SIZE))
>
> Should this now use PAGE_SIZE rather than SECTION_SIZE since we won't
> be using a section mapping?
>

The early boot code will still be using a section mapping, and so it
implicitly performs the same conversion as FDT_VIRT_BASE does now.

If we change this definition, the virtual mapping of the DT may shift
around in memory when we switch from the early to the permanent
mapping, which means we'll have to fix up initial_boot_params too.

So I think it is easier just to leave it as is.



More information about the linux-arm-kernel mailing list