Re: [PATCH] arm64: add early fixmap initialization flag

From: Mark Rutland
Date: Thu Feb 22 2024 - 06:00:11 EST


On Wed, Feb 21, 2024 at 08:14:00AM +0900, Itaru Kitayama wrote:
> On Tue, Feb 20, 2024 at 11:55:30AM +0000, Mark Rutland wrote:
> > From 5f07f9c1d352f760fa7aba97f1b4f42d9cb99496 Mon Sep 17 00:00:00 2001
> > From: Mark Rutland <mark.rutland@xxxxxxx>
> > Date: Tue, 20 Feb 2024 11:09:17 +0000
> > Subject: [PATCH] arm64: clean up fixmap initalization
> >
> > Currently we have redundant initialization of the fixmap, first in
> > early_fdt_map(), and then again in setup_arch() before we call
> > early_ioremap_init(). This redundant initialization isn't harmful, as
> > early_fixmap_init() happens to be idempotent, but it's redundant and
> > potentially confusing.
> >
> > We need to call early_fixmap_init() before we map the FDT and before we
> > call early_ioremap_init(). Ideally we'd place early_fixmap_init() and
> > early_ioremap_init() in the same caller as early_ioremap_init() is
> > somewhat coupled with the fixmap code.
> >
> > Clean this up by moving the calls to early_fixmap_init() and
> > early_ioremap_init() into a new early_mappings_init() function, and
> > calling this once in __primary_switched() before we call
> > early_fdt_map(). This means we initialize the fixmap once, and keep
> > early_fixmap_init() and early_ioremap_init() together.

> Thanks for this. Makes sense to me; would you post a proper patch
> so I can build and do a boot test, just to make sure?

I took a look, and Ard's recent changes to the boot code have removed the
duplicate call to early_fixmap_init() by other means, so we don't need to do
anything, and can forget about this patch. :)

Mark.