Skip to content

Commit 8af6b91

Browse files
Zhen Leictmarinas
authored andcommitted
of: Support more than one crash kernel regions for kexec -s
When "crashkernel=X,high" is used, there may be two crash regions: high=crashk_res and low=crashk_low_res. But now the syscall kexec_file_load() only add crashk_res into "linux,usable-memory-range", this may cause the second kernel to have no available dma memory. Fix it like kexec-tools does for option -c, add both 'high' and 'low' regions into the dtb. Signed-off-by: Zhen Lei <[email protected]> Acked-by: Rob Herring <[email protected]> Acked-by: Baoquan He <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent fb319e7 commit 8af6b91

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/of/kexec.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,15 @@ void *of_kexec_alloc_and_setup_fdt(const struct kimage *image,
386386
crashk_res.end - crashk_res.start + 1);
387387
if (ret)
388388
goto out;
389+
390+
if (crashk_low_res.end) {
391+
ret = fdt_appendprop_addrrange(fdt, 0, chosen_node,
392+
"linux,usable-memory-range",
393+
crashk_low_res.start,
394+
crashk_low_res.end - crashk_low_res.start + 1);
395+
if (ret)
396+
goto out;
397+
}
389398
}
390399

391400
/* add bootargs */

0 commit comments

Comments
 (0)