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 <thunder.leizhen@huawei.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Baoquan He <bhe@redhat.com>
Link: https://lore.kernel.org/r/20220506114402.365-6-thunder.leizhen@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
 
                                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 */