RISC-V: Set maximum number of mapped pages correctly
authorAtish Patra <atish.patra@wdc.com>
Wed, 15 Jul 2020 23:30:07 +0000 (16:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2020 07:58:50 +0000 (09:58 +0200)
commitfe1ab9c0f047d4a89d94d06842a3bb10a6b24978
treeec46647d41d60374e50533ac56499d343182e024
parentcb748f1cf7d365c849f170073196698ec69df7ea
RISC-V: Set maximum number of mapped pages correctly

[ Upstream commit d0d8aae64566b753c4330fbd5944b88af035f299 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/mm/init.c