LoongArch: numa: Fix high_memory calculation
authorHuacai Chen <chenhuacai@loongson.cn>
Wed, 27 Sep 2023 08:19:13 +0000 (16:19 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Wed, 27 Sep 2023 08:19:13 +0000 (16:19 +0800)
commit1943feecf80e73ecc03ce40271f29c6cea142bac
tree912d84d3a1cc0c6bababc6dab05f1ea0a32a2207
parent6465e260f48790807eef06b583b38ca9789b6072
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: d4b6f1562a3c3284adce ("LoongArch: Add Non-Uniform Memory Access (NUMA) support")
Signed-off-by: Chong Qiao <qiaochong@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kernel/numa.c