Commit 1943feec authored by Huacai Chen's avatar Huacai Chen

LoongArch: numa: Fix high_memory calculation

For 64bit kernel without HIGHMEM, high_memory is the virtual address of
the highest physical address in the system. But __va(get_num_physpages()
<< PAGE_SHIFT) is not what we want for high_memory because there may be
holes in the physical address space. On the other hand, max_low_pfn is
calculated from memblock_end_of_DRAM(), which is exactly corresponding
to the highest physical address, so use it for high_memory calculation.

Cc: <stable@vger.kernel.org>
Fixes: d4b6f156 ("LoongArch: Add Non-Uniform Memory Access (NUMA) support")
Signed-off-by: default avatarChong Qiao <qiaochong@loongson.cn>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent 6465e260
...@@ -436,7 +436,7 @@ void __init paging_init(void) ...@@ -436,7 +436,7 @@ void __init paging_init(void)
void __init mem_init(void) void __init mem_init(void)
{ {
high_memory = (void *) __va(get_num_physpages() << PAGE_SHIFT); high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
memblock_free_all(); memblock_free_all();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment