Jan Beulich
2011-Dec-07 14:09 UTC
[PATCH] linux-2.6.18/kexec: don''t initialize when no crash area was reserved
While the waste of memory needed may not be significant, the amount of additional but pointless entries in /proc/iomem certainly may be (on large systems). Signed-off-by: Jan Beulich <jbeulich@suse.com> --- a/drivers/xen/core/machine_kexec.c +++ b/drivers/xen/core/machine_kexec.c @@ -34,6 +34,17 @@ void __init xen_machine_kexec_setup_reso if (!is_initial_xendomain()) return; + /* fill in crashk_res if range is reserved by hypervisor */ + memset(&range, 0, sizeof(range)); + range.range = KEXEC_RANGE_MA_CRASH; + + if (HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range) + || !range.size) + return; + + crashk_res.start = range.start; + crashk_res.end = range.start + range.size - 1; + /* determine maximum number of physical cpus */ op.cmd = XENPF_get_cpuinfo; op.u.pcpu_info.xen_cpuid = 0; @@ -96,19 +107,6 @@ void __init xen_machine_kexec_setup_reso xen_hypervisor_res.end = range.start + range.size - 1; xen_hypervisor_res.flags = IORESOURCE_BUSY | IORESOURCE_MEM; - /* fill in crashk_res if range is reserved by hypervisor */ - - memset(&range, 0, sizeof(range)); - range.range = KEXEC_RANGE_MA_CRASH; - - if (HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range)) - goto free; - - if (range.size) { - crashk_res.start = range.start; - crashk_res.end = range.start + range.size - 1; - } - /* get physical address of vmcoreinfo */ memset(&range, 0, sizeof(range)); range.range = KEXEC_RANGE_MA_VMCOREINFO; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel