Re: [PATCH v2 2/5] arm64/mm: drop vmemmap_pmd helpers and use generic code

From: Will Deacon

Date: Mon May 18 2026 - 08:45:56 EST


On Sat, Apr 04, 2026 at 08:20:55PM +0800, Muchun Song wrote:
> The generic implementations now suffice; remove the arm64 copies.
>
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
> ---
> arch/arm64/mm/mmu.c | 14 --------------
> 1 file changed, 14 deletions(-)
>
> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> index ec1c6971a561..b87053452641 100644
> --- a/arch/arm64/mm/mmu.c
> +++ b/arch/arm64/mm/mmu.c
> @@ -1745,20 +1745,6 @@ static void free_empty_tables(unsigned long addr, unsigned long end,
> }
> #endif
>
> -void __meminit vmemmap_set_pmd(pmd_t *pmdp, void *p, int node,
> - unsigned long addr, unsigned long next)
> -{
> - pmd_set_huge(pmdp, __pa(p), __pgprot(PROT_SECT_NORMAL));
> -}
> -
> -int __meminit vmemmap_check_pmd(pmd_t *pmdp, int node,
> - unsigned long addr, unsigned long next)
> -{
> - vmemmap_verify((pte_t *)pmdp, node, addr, next);
> -
> - return pmd_sect(READ_ONCE(*pmdp));
> -}

I think this is fine:

Acked-by: Will Deacon <will@xxxxxxxxxx>

but note that, since c25c4aa3f79a ("arm64: mm: Add PTE_DIRTY back to
PAGE_KERNEL* to fix kexec/hibernation"), I think that using PAGE_KERNEL
(like the generic code does in the first patch of this series) means
that this change isn't a no-op -- it means that the huge entries will
now be marked as dirty. That's possibly a bug fix (?)

Will