PowerPC radix currently uses a private HVO vmemmap population path because the generic path lacks several properties it requires. This duplicates the generic sparse-vmemmap page-table walk even though the HVO layout itself does not require architecture-specific handling.
First, PowerPC uses the regular page-table allocators for runtime vmemmap tables, while the generic path uses vmemmap_alloc_block() for intermediate tables, bypassing the normal page-table constructor and destructor lifecycle. Second, with 64 KiB base pages, multiple sparsemem sections can share one vmemmap PTE. The generic HVO path rejects an existing PTE even when it maps the expected shared tail page. Third, a PMD-sized vmemmap mapping can also span multiple sections. An HVO-capable section can therefore encounter an ordinary mapping created for a neighboring section. The generic path rejects it instead of reusing it and disabling HVO for the current section. This series removes these restrictions. Patches 1 and 2 address the first issue, patch 3 the second, and patch 4 the third. Patch 5 is a standalone fix posted earlier but not yet merged: https://lore.kernel.org/all/[email protected]/ Since the final conversion removes the affected PowerPC code, carrying the fix here preserves it as a distinct commit that can be backported to kernels using the old implementation. Patches 6 and 7 then remove the PowerPC-specific PMD overrides and HVO page-table walk, and switch radix to the generic path. Muchun Song (7): mm/sparse-vmemmap: use page-table constructors for runtime tables mm/sparse-vmemmap: align page-table helpers with core MM mm/sparse-vmemmap: introduce vmemmap_optimizable_pte_populate mm/sparse-vmemmap: support PMD mappings spanning sections powerpc/mm: fix uninitialized ZONE_DEVICE struct pages with PMDs powerpc/mm: remove radix-specific vmemmap PMD overrides powerpc/mm: reuse generic HVO vmemmap population arch/powerpc/mm/book3s64/radix_pgtable.c | 167 ++--------------- mm/sparse-vmemmap.c | 219 ++++++++++++++--------- 2 files changed, 148 insertions(+), 238 deletions(-) base-commit: 872ceec1e3caf227655a58f7407a9c8493dcf56f -- 2.54.0
