Message ID | 20220505091845.167-6-thunder.leizhen@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | support reserving crashkernel above 4G on arm64 kdump | expand |
On Thu, 05 May 2022 17:18:44 +0800, Zhen Lei wrote: > 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 tool do for option -c, add both 'high' and 'low' regions > into the dtb. > > Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> > --- > drivers/of/kexec.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > Acked-by: Rob Herring <robh@kernel.org>
diff --git a/drivers/of/kexec.c b/drivers/of/kexec.c index b9bd1cff179388c..8d374cc552be5f2 100644 --- a/drivers/of/kexec.c +++ b/drivers/of/kexec.c @@ -386,6 +386,15 @@ void *of_kexec_alloc_and_setup_fdt(const struct kimage *image, crashk_res.end - crashk_res.start + 1); if (ret) goto out; + + if (crashk_low_res.end) { + ret = fdt_appendprop_addrrange(fdt, 0, chosen_node, + "linux,usable-memory-range", + crashk_low_res.start, + crashk_low_res.end - crashk_low_res.start + 1); + if (ret) + goto out; + } } /* add bootargs */
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 tool do for option -c, add both 'high' and 'low' regions into the dtb. Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> --- drivers/of/kexec.c | 9 +++++++++ 1 file changed, 9 insertions(+)