From: Zhenhua Huang Date: Thu, 2 Jan 2025 07:40:47 +0000 (+0800) Subject: arm64: mm: Test for pmd_sect() in vmemmap_check_pmd() X-Git-Tag: v6.14-rc1~198^2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ab2601dc4c145279dc518bca00349dc1abe77ed;p=thirdparty%2Fkernel%2Flinux.git arm64: mm: Test for pmd_sect() in vmemmap_check_pmd() Commit 2045a3b8911b ("mm/sparse-vmemmap: generalise vmemmap_populate_hugepages()") introduces the vmemmap_check_pmd() while does not verify if the entry is a section mapping, as is already done for Loongarch & X86. The update includes a check for pmd_sect(). Only if pmd_sect() returns true, further vmemmap population for the addr is skipped. Signed-off-by: Zhenhua Huang Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20250102074047.674156-1-quic_zhenhuah@quicinc.com Signed-off-by: Will Deacon --- diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index e2739b69e11bd..b4df5bc5b1b8b 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1169,7 +1169,8 @@ 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 1; + + return pmd_sect(READ_ONCE(*pmdp)); } int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,