提交 344bf332 编写于 作者: M Muchun Song 提交者: Will Deacon

arm64: mm: fix incorrect assignment of 'max_mapnr'

Although we don't actually make use of the 'max_mapnr' global variable,
we do set it to a junk value for !CONFIG_FLATMEM configurations that
leave mem_map uninitialised.

To avoid somebody tripping over this in future, set 'max_mapnr' using
max_pfn, which is calculated directly from the memblock information.
Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: NMuchun Song <smuchun@gmail.com>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 79a3aaa7
......@@ -535,7 +535,7 @@ void __init mem_init(void)
else
swiotlb_force = SWIOTLB_NO_FORCE;
set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
set_max_mapnr(max_pfn - PHYS_PFN_OFFSET);
#ifndef CONFIG_SPARSEMEM_VMEMMAP
free_unused_memmap();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册