Commit 9ab2601d authored by Zhenhua Huang's avatar Zhenhua Huang Committed by Will Deacon
Browse files

arm64: mm: Test for pmd_sect() in vmemmap_check_pmd()



Commit 2045a3b8 ("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: default avatarZhenhua Huang <quic_zhenhuah@quicinc.com>
Reviewed-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20250102074047.674156-1-quic_zhenhuah@quicinc.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent fe2169f5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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,