* [PATCH] Don't use /sys/firmware/memmap for Xen
@ 2008-11-25 12:49 Bernhard Walle
2008-11-26 8:46 ` Bernhard Walle
0 siblings, 1 reply; 4+ messages in thread
From: Bernhard Walle @ 2008-11-25 12:49 UTC (permalink / raw)
To: kexec; +Cc: Bernhard Walle
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 <bwalle@suse.de>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Don't use /sys/firmware/memmap for Xen
2008-11-25 12:49 [PATCH] Don't use /sys/firmware/memmap for Xen Bernhard Walle
@ 2008-11-26 8:46 ` Bernhard Walle
0 siblings, 0 replies; 4+ messages in thread
From: Bernhard Walle @ 2008-11-26 8:46 UTC (permalink / raw)
To: kexec
* Bernhard Walle [2008-11-25 13:49]:
>
> 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)
I just noticed that this has a compile warning. A fixed patch follows.
Bernhard
--
Bernhard Walle, SUSE Linux Products GmbH, Architecture Development
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Don't use /sys/firmware/memmap for Xen
@ 2008-11-26 9:00 Bernhard Walle
2008-11-28 4:53 ` Simon Horman
0 siblings, 1 reply; 4+ messages in thread
From: Bernhard Walle @ 2008-11-26 9:00 UTC (permalink / raw)
To: kexec; +Cc: Bernhard Walle
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 <bwalle@suse.de>
---
kexec/arch/i386/kexec-x86-common.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/kexec/arch/i386/kexec-x86-common.c b/kexec/arch/i386/kexec-x86-common.c
index 00c2be3..1453780 100644
--- a/kexec/arch/i386/kexec-x86-common.c
+++ b/kexec/arch/i386/kexec-x86-common.c
@@ -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);
--
1.6.0.2
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Don't use /sys/firmware/memmap for Xen
2008-11-26 9:00 Bernhard Walle
@ 2008-11-28 4:53 ` Simon Horman
0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2008-11-28 4:53 UTC (permalink / raw)
To: Bernhard Walle; +Cc: kexec
On Wed, Nov 26, 2008 at 10:00:39AM +0100, Bernhard Walle wrote:
> 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.
Thanks Bernhard, applied.
--
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
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-11-28 4:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-25 12:49 [PATCH] Don't use /sys/firmware/memmap for Xen Bernhard Walle
2008-11-26 8:46 ` Bernhard Walle
-- strict thread matches above, loose matches on Subject: below --
2008-11-26 9:00 Bernhard Walle
2008-11-28 4:53 ` Simon Horman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.