Commit 88d74c39 authored by Zhen Lei's avatar Zhen Lei Committed by Zheng Zengkai
Browse files

of: Enable crashkernel=X,high to support kexec option -s

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I545H8


CVE: NA

-------------------------------------------------------------------------

For "crashkernel=X,high", there must be two crash regions: high=crashk_res
and low=crashk_low_res. But now the syscall kexec_file_load() only add the
crashk_res into "linux,usable-memory-range", this causes the second kernel
to have no available dma memory. Fix it like kexec tool do for option -c.

Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent c090cac1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -396,6 +396,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,
					FDT_PROP_MEM_RANGE,
					crashk_low_res.start,
					crashk_low_res.end - crashk_low_res.start + 1);
			if (ret)
				goto out;
		}
	}

	/* add bootargs */