Commit 336e8eb2 authored by Guo Ren's avatar Guo Ren Committed by Palmer Dabbelt

riscv: Fixup pfn_valid error with wrong max_mapnr

The max_mapnr is the number of PFNs, not absolute PFN offset.
Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
Fixes: d0d8aae6 ("RISC-V: Set maximum number of mapped pages correctly")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent 19c329f6
...@@ -196,7 +196,7 @@ void __init setup_bootmem(void) ...@@ -196,7 +196,7 @@ void __init setup_bootmem(void)
max_pfn = PFN_DOWN(dram_end); max_pfn = PFN_DOWN(dram_end);
max_low_pfn = max_pfn; max_low_pfn = max_pfn;
dma32_phys_limit = min(4UL * SZ_1G, (unsigned long)PFN_PHYS(max_low_pfn)); dma32_phys_limit = min(4UL * SZ_1G, (unsigned long)PFN_PHYS(max_low_pfn));
set_max_mapnr(max_low_pfn); set_max_mapnr(max_low_pfn - ARCH_PFN_OFFSET);
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
setup_initrd(); setup_initrd();
......
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