@@ -456,7 +456,6 @@ static int __init reserve_crashkernel_low(void)
crashk_low_res.start = low_base;
crashk_low_res.end = low_base + low_size - 1;
- insert_resource(&iomem_resource, &crashk_low_res);
#endif
return 0;
}
@@ -480,11 +479,6 @@ static void __init reserve_crashkernel(void)
high = true;
}
- if (xen_pv_domain()) {
- pr_info("Ignoring crashkernel for a Xen PV domain\n");
- return;
- }
-
/* 0 means: find the address automatically */
if (!crash_base) {
/*
@@ -531,7 +525,6 @@ static void __init reserve_crashkernel(void)
crashk_res.start = crash_base;
crashk_res.end = crash_base + crash_size - 1;
- insert_resource(&iomem_resource, &crashk_res);
}
#else
static void __init reserve_crashkernel(void)
@@ -1143,7 +1136,17 @@ void __init setup_arch(char **cmdline_p)
* Reserve memory for crash kernel after SRAT is parsed so that it
* won't consume hotpluggable memory.
*/
- reserve_crashkernel();
+ if (xen_pv_domain())
+ pr_info("Ignoring crashkernel for a Xen PV domain\n");
+ else {
+ reserve_crashkernel();
+#ifdef CONFIG_KEXEC_CORE
+ if (crashk_res.end > crashk_res.start)
+ insert_resource(&iomem_resource, &crashk_res);
+ if (crashk_low_res.end > crashk_low_res.start)
+ insert_resource(&iomem_resource, &crashk_low_res);
+#endif
+ }
memblock_find_dma_reserve();