[PATCH 5/5] riscv: mm: Reserve the DTB before scanning reserved memory

sashiko-bot at kernel.org sashiko-bot at kernel.org
Fri Oct 23 01:06:59 PDT 2026


> From: Han Gao <gaohan at iscas.ac.cn>
> 
> setup_bootmem() reserves the DTB only after
> early_init_fdt_scan_reserved_mem() has allocated the dynamically placed
> reserved-memory regions. A CMA pool described with size and alloc-ranges
> can therefore be placed over the DTB, which is later handed to the page
> allocator and overwritten.
> 
> This happens after kexec_file has put the DTB of the next kernel in CMA:
> the next kernel reuses that range for its own pool, and a further
> kexec_file_load() fails with -FDT_ERR_BADMAGIC.
> 
> Reserve the DTB first.
> 
> Fixes: ef69d2559fe9 ("riscv: Move early dtb mapping into the fixmap region")
> Signed-off-by: Han Gao <gaohan at iscas.ac.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261023-riscv-kexec-cma-fixes-v1-0-825b90ea23c4@iscas.ac.cn?part=5




More information about the kexec mailing list