riscv: Get rid of MAX_EARLY_MAPPING_SIZE
authorAlexandre Ghiti <alex@ghiti.fr>
Sun, 21 Feb 2021 14:22:33 +0000 (09:22 -0500)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Tue, 23 Feb 2021 02:38:49 +0000 (18:38 -0800)
commit0f02de4481da684aad6589aed0ea47bd1ab391c9
tree2f1a3224b439c0f3aa0903f6883612c8b7909579
parente134d426e1a3b854cb6b62fad818677e58b087d5
riscv: Get rid of MAX_EARLY_MAPPING_SIZE

At early boot stage, we have a whole PGDIR to map the kernel, so there
is no need to restrict the early mapping size to 128MB. Removing this
define also allows us to simplify some compile time logic.

This fixes large kernel mappings with a size greater than 128MB, as it
is the case for syzbot kernels whose size was just ~130MB.

Note that on rv64, for now, we are then limited to PGDIR size for early
mapping as we can't use PGD mappingsĀ (see [1]). That should be enough
given the relative small size of syzbot kernels compared to PGDIR_SIZE
which is 1GB.

[1] https://lore.kernel.org/lkml/20200603153608.30056-1-alex@ghiti.fr/

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/mm/init.c