On Xen, we have to use /proc/iomem to retrieve the memory area for the kexec'd
kernel, not /sys/firmware/memmap. Dom0 kernel gets a E820 map that contains
only one region:

    0000000000000000-0000000018e5e000 (System RAM)

Compared to the /proc/iomem:

    00000000-0009cbff : System RAM
    0009cc00-0009ffff : reserved
    000ce000-000d3fff : reserved
    000e0000-000fffff : reserved
    00100000-1fd6ffff : System RAM
      01000000-04ffffff : Crash kernel
      1ec00000-1fbfffff : Hypervisor code and data
        1f0b4680-1f0b4873 : Crash note
        1f0b4900-1f0b4a93 : Crash note
        1f0b4b80-1f0b4d13 : Crash note
        1f0b4e00-1f0b4f93 : Crash note
    ...

Without that patch, /proc/vmcore is empty in the kexec'd kernel and I'm unable
to copy the crashdump.


Signed-off-by: Bernhard Walle <[EMAIL PROTECTED]>
---
 kexec/arch/i386/kexec-x86-common.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/kexec/arch/i386/kexec-x86-common.c 
b/kexec/arch/i386/kexec-x86-common.c
index 00c2be3..2112bd5 100644
--- a/kexec/arch/i386/kexec-x86-common.c
+++ b/kexec/arch/i386/kexec-x86-common.c
@@ -147,7 +147,14 @@ int get_memory_ranges(struct memory_range **range, int 
*ranges,
 {
        int ret, i;
 
-       if (have_sys_firmware_memmap())
+       /*
+        * When using Xen, /sys/firmware/memmap (i.e., the E820 map) is
+        * wrong, it just provides one large memory are and that cannot
+        * be used for Kdump. Use always the /proc/iomem interface there
+        * even if we have /sys/firmware/memmap. Without that, /proc/vmcore
+        * is empty in the kdump kernel.
+        */
+       if (!xen_present() && have_sys_firmware_memmap())
                ret = get_memory_ranges_sysfs(range, ranges);
        else
                ret = get_memory_ranges_proc_iomem(range, ranges);
-- 
1.6.0.2


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to