]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Sun, 4 Oct 2020 23:19:28 +0000 (16:19 -0700)
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>
arch/riscv/mm/init.c

index ca03762a373382e04af23bfbf5417c09acb06356..f750e012dbe588e03cb2eb549422912c4d7fbd83 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)