From: Atish Patra Date: Thu, 1 Oct 2020 19:04:56 +0000 (-0700) Subject: RISC-V: Make sure memblock reserves the memory containing DT X-Git-Tag: v5.8.15~96 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=987c12d5640285219f66689a3552d6248fba5350;p=thirdparty%2Fkernel%2Fstable.git RISC-V: Make sure memblock reserves the memory containing DT commit a78c6f5956a949b496a5b087188dde52483edf51 upstream. Currently, the memory containing DT is not reserved. Thus, that region of memory can be reallocated or reused for other purposes. This may result in corrupted DT for nommu virt board in Qemu. We may not face any issue in kendryte as DT is embedded in the kernel image for that. Fixes: 6bd33e1ece52 ("riscv: add nommu support") Cc: stable@vger.kernel.org Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index e229d95f470b8..7c1dadf14f567 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -515,6 +515,7 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa) #else dtb_early_va = (void *)dtb_pa; #endif + dtb_early_pa = dtb_pa; } static inline void setup_vm_final(void)