]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
RISC-V: Make sure memblock reserves the memory containing DT
authorAtish Patra <atish.patra@wdc.com>
Thu, 1 Oct 2020 19:04:56 +0000 (12:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Oct 2020 09:55:48 +0000 (11:55 +0200)
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 <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/riscv/mm/init.c

index e229d95f470b89616abe279a16f1cd75c5c011cb..7c1dadf14f5676fa2ebd303a0abbb7dcccc03ff3 100644 (file)
@@ -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)