Don't use /sys/firmware/memmap for Xen
Subsystems (2)
PATCH 1/1 Don't use /sys/firmware/memmap for Xen
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 | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
kexec/arch/i386/kexec-x86-common.c +9 -1
@@ -27,6 +27,7 @@#include "../../kexec.h" #include "../../kexec-syscall.h" #include "../../firmware_memmap.h" +#include "../../crashdump.h" #include "kexec-x86.h" static struct memory_range memory_range[MAX_MEMORY_RANGES ];
@@ -147,7 +148,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);
Signature · 7 lines
1.6.0.2 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 21 lines · Bernhard Walle
On Xen, we have to use
/proc/iomemto 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 ...
Quoted 2 lines
Without that patch,
/proc/vmcoreis empty in the kexec'd kernel and I'm unable to copy the crashdump.
Thanks Bernhard, applied.
Signature · 9 lines
Simon Horman VA Linux Systems Japan K.K., Sydney, Australia Satellite Office H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec