summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kexec/arch/i386/crashdump-x86.c6
-rw-r--r--kexec/arch/i386/crashdump-x86.h3
2 files changed, 6 insertions, 3 deletions
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index 43e830a3..df84185d 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -355,8 +355,8 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
static int get_crash_memory_ranges_xen(struct memory_range **range,
int *ranges, unsigned long lowmem_limit)
{
+ struct e820entry *e820entries;
int j, rc, ret = -1;
- struct e820entry e820entries[CRASH_MAX_MEMORY_RANGES];
unsigned int i;
xc_interface *xc;
@@ -367,6 +367,8 @@ static int get_crash_memory_ranges_xen(struct memory_range **range,
return -1;
}
+ e820entries = xmalloc(sizeof(*e820entries) * CRASH_MAX_MEMORY_RANGES);
+
rc = xc_get_machine_memory_map(xc, e820entries, CRASH_MAX_MEMORY_RANGES);
if (rc < 0) {
@@ -395,7 +397,7 @@ static int get_crash_memory_ranges_xen(struct memory_range **range,
err:
xc_interface_close(xc);
-
+ free(e820entries);
return ret;
}
#else
diff --git a/kexec/arch/i386/crashdump-x86.h b/kexec/arch/i386/crashdump-x86.h
index e4fdc824..479a5491 100644
--- a/kexec/arch/i386/crashdump-x86.h
+++ b/kexec/arch/i386/crashdump-x86.h
@@ -22,7 +22,8 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
#define X86_64_KERNEL_TEXT_SIZE (512UL*1024*1024)
#define CRASH_MAX_MEMMAP_NR 1024
-#define CRASH_MAX_MEMORY_RANGES (MAX_MEMORY_RANGES + 2)
+
+#define CRASH_MAX_MEMORY_RANGES 32768
/* Backup Region, First 640K of System RAM. */
#define BACKUP_SRC_START 0x00000000