summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2020-07-15 16:30:07 -0700
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-07-24 18:53:42 -0700
commitd0d8aae64566b753c4330fbd5944b88af035f299 (patch)
tree14fb81df49acfc0bb108a769fa5e98de8031b04e
parent4cb699d0447be8e0906539f93cbe41e19598ee5a (diff)
downloadlinux-d0d8aae64566b753c4330fbd5944b88af035f299.tar.gz
linux-d0d8aae64566b753c4330fbd5944b88af035f299.tar.bz2
linux-d0d8aae64566b753c4330fbd5944b88af035f299.zip
RISC-V: Set maximum number of mapped pages correctly
Currently, maximum number of mapper pages are set to the pfn calculated from the memblock size of the memblock containing kernel. This will work until that memblock spans the entire memory. However, it will be set to a wrong value if there are multiple memblocks defined in kernel (e.g. with efi runtime services). Set the the maximum value to the pfn calculated from dram size. Signed-off-by: Atish Patra <atish.patra@wdc.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
-rw-r--r--arch/riscv/mm/init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index f4adb3684f3d..8d22973bde40 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -150,9 +150,9 @@ void __init setup_bootmem(void)
/* Reserve from the start of the kernel to the end of the kernel */
memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);
- set_max_mapnr(PFN_DOWN(mem_size));
max_pfn = PFN_DOWN(memblock_end_of_DRAM());
max_low_pfn = max_pfn;
+ set_max_mapnr(max_low_pfn);
#ifdef CONFIG_BLK_DEV_INITRD
setup_initrd();