riscv: change XIP's kernel_map.size to be size of the entire kernel
authorNam Cao <namcao@linutronix.de>
Wed, 8 May 2024 19:19:17 +0000 (21:19 +0200)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 14 Aug 2024 20:12:33 +0000 (13:12 -0700)
commit57d76bc51fd80824bcc0c84a5b5ec944f1b51edd
tree318ad4f53dcc3deae6d5ebb86a3ed46c82d4da01
parent61119394631f219e23ce98bcc3eb993a64a8ea64
riscv: change XIP's kernel_map.size to be size of the entire kernel

With XIP kernel, kernel_map.size is set to be only the size of data part of
the kernel. This is inconsistent with "normal" kernel, who sets it to be
the size of the entire kernel.

More importantly, XIP kernel fails to boot if CONFIG_DEBUG_VIRTUAL is
enabled, because there are checks on virtual addresses with the assumption
that kernel_map.size is the size of the entire kernel (these checks are in
arch/riscv/mm/physaddr.c).

Change XIP's kernel_map.size to be the size of the entire kernel.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Cc: <stable@vger.kernel.org> # v6.1+
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20240508191917.2892064-1-namcao@linutronix.de
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/mm/init.c