diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index aee6031230306a934747c64edb4b61f6928e9e8b..b2d26d9d8489c8e8b6bba01adee0c573fd6564f8 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -186,7 +186,7 @@ static void __init setup_bootmem(void) BUG_ON(mem_size == 0); set_max_mapnr(PFN_DOWN(mem_size)); - max_low_pfn = pfn_base + PFN_DOWN(mem_size); + max_low_pfn = memblock_end_of_DRAM(); #ifdef CONFIG_BLK_DEV_INITRD setup_initrd();