RISC-V: Fix usage of memblock_enforce_memory_limit

memblock_enforce_memory_limit accepts the maximum memory size not the
maximum address that can be handled by kernel. Fix the function invocation
accordingly.

Fixes: 1bd14a66ee ("RISC-V: Remove any memblock representing unusable memory area")
Cc: stable@vger.kernel.org
Reported-by: Bin Meng <bin.meng@windriver.com>
Tested-by: Bin Meng <bin.meng@windriver.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
Atish Patra 2020-12-18 16:13:56 -08:00 committed by Palmer Dabbelt
parent e2ae634014
commit de043da0b9
No known key found for this signature in database
GPG Key ID: 2E1319F35FBB1889
1 changed files with 1 additions and 1 deletions

View File

@ -176,7 +176,7 @@ void __init setup_bootmem(void)
* Make sure that any memory beyond mem_start + (-PAGE_OFFSET) is removed * Make sure that any memory beyond mem_start + (-PAGE_OFFSET) is removed
* as it is unusable by kernel. * as it is unusable by kernel.
*/ */
memblock_enforce_memory_limit(mem_start - PAGE_OFFSET); memblock_enforce_memory_limit(-PAGE_OFFSET);
/* Reserve from the start of the kernel to the end of the kernel */ /* Reserve from the start of the kernel to the end of the kernel */
memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start); memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);