Re: [PATCH v2 0/3] x86/mm: some cleanups for pagetable setup code

From: Brendan Jackman

Date: Wed May 27 2026 - 08:45:20 EST


Hi folks,

Can someone take a look at this?

Sashiko claims to have pointed out some pre-existing issues [0]:

- No synchronisation for pfn_mapped. Maybe this could be fixed by
spraying some get_online_mems() or something? Fixing this individual
bug in isolation seems a bit pointless though, whenever I look into
data structures that get modified during hotplug I get the feeling the
synchronisation needs a pretty wide overhaul. Maybe someone else feels
differently...

- Points out that phys_p4d_init() operates on a single P4D table but
doesn't seem to check that the addresses it's operating on are within
a single PGD.

I'm pretty sure I noticed this before but assumed it was impossible
for the range to span multiple PGDs here. But now I look more
carefully I see that's not true and I think Sashiko is right here.

It also points out that the paddr >= paddr_end check looks
unreachable, which sounds plausible but I haven't thought it through
properly.

Happy to fix the latter as an additional patch but I think the rest of
this is ready for review regardless.

[0]: https://sashiko.dev/#/patchset/20260503-x86-init-cleanup-v2-0-bb690bd2477c%40google.com

Cheers,
Brendan