* [PATCH] IA64 kexec-tools: efi_memmap overflow on large systems
@ 2007-02-01 1:54 Jay Lan
2007-02-01 2:43 ` Zou, Nanhai
0 siblings, 1 reply; 2+ messages in thread
From: Jay Lan @ 2007-02-01 1:54 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
This patch fixes a efi_memmap overflow problem on large system.
Currently the kexec allocates statically 16k buffer to contain
efi_memmap. It can hold about 333 entries. It causes data
corruption on large system.
This patch would let kexec allocate the efi_memmap at run time using
the actual size allocated in the production kernel.
Signed-off-by: Jay Lan <jlan@sgi.com>
[-- Attachment #2: efi-memmap-overflow --]
[-- Type: text/plain, Size: 1912 bytes --]
Index: kexec-tools-testing-20061214/kexec/arch/ia64/kexec-elf-ia64.c
===================================================================
--- kexec-tools-testing-20061214.orig/kexec/arch/ia64/kexec-elf-ia64.c 2006-12-14 01:12:03.000000000 -0600
+++ kexec-tools-testing-20061214/kexec/arch/ia64/kexec-elf-ia64.c 2007-01-31 19:33:23.000000000 -0600
@@ -47,6 +47,7 @@
#include <arch/options.h>
static const int probe_debug = 0;
+extern unsigned long saved_efi_memmap_size;
/*
* elf_ia64_probe - sanity check the elf image
@@ -229,8 +230,8 @@ int elf_ia64_load(int argc, char **argv,
elf_rel_set_symbol(&info->rhdr, "__boot_param_base",
&boot_param_base, sizeof(long));
- // reserve 8k for efi_memmap
- efi_memmap_size = 1UL<<14;
+ // reserve efi_memmap of actual size allocated in production kernel
+ efi_memmap_size = saved_efi_memmap_size;
efi_memmap_buf = xmalloc(efi_memmap_size);
efi_memmap_base = add_buffer(info, efi_memmap_buf,
efi_memmap_size, efi_memmap_size, 4096, 0,
Index: kexec-tools-testing-20061214/kexec/arch/ia64/kexec-ia64.c
===================================================================
--- kexec-tools-testing-20061214.orig/kexec/arch/ia64/kexec-ia64.c 2006-12-14 01:12:03.000000000 -0600
+++ kexec-tools-testing-20061214/kexec/arch/ia64/kexec-ia64.c 2007-01-31 19:35:20.000000000 -0600
@@ -38,6 +38,7 @@
static struct memory_range memory_range[MAX_MEMORY_RANGES];
static int memory_ranges;
+unsigned long saved_efi_memmap_size;
/* Reserve range for EFI memmap and Boot parameter */
static int split_range(int range, unsigned long start, unsigned long end)
@@ -124,6 +125,7 @@ int get_memory_ranges(struct memory_rang
continue;
} else if (memcmp(str, "EFI Memory Map\n", 14) == 0) {
memory_ranges = split_range(memory_ranges, start, end);
+ saved_efi_memmap_size = end - start;
continue;
} else
continue;
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] IA64 kexec-tools: efi_memmap overflow on large systems
2007-02-01 1:54 [PATCH] IA64 kexec-tools: efi_memmap overflow on large systems Jay Lan
@ 2007-02-01 2:43 ` Zou, Nanhai
0 siblings, 0 replies; 2+ messages in thread
From: Zou, Nanhai @ 2007-02-01 2:43 UTC (permalink / raw)
To: linux-ia64
> -----Original Message-----
> From: Jay Lan [mailto:jlan@sgi.com]
> Sent: 2007Äê2ÔÂ1ÈÕ 9:54
> To: fastboot
> Cc: Linux-IA64; Zou, Nanhai
> Subject: [PATCH] IA64 kexec-tools: efi_memmap overflow on large systems
>
> This patch fixes a efi_memmap overflow problem on large system.
> Currently the kexec allocates statically 16k buffer to contain
> efi_memmap. It can hold about 333 entries. It causes data
> corruption on large system.
>
> This patch would let kexec allocate the efi_memmap at run time using
> the actual size allocated in the production kernel.
>
>
> Signed-off-by: Jay Lan <jlan@sgi.com>
Another hardcode limit needs to be eliminated, the CRASH_MAX_MEMORY_RANGE in crashdump-ia64.c.
Since SN systems may scale to hundreds of nodes, each node may contain up to 12 DIMMs.
I guess the current 1024 limit is not enough for those super computers.
So we need to count crash memory ranges from /proc/iomem and allocated crash_memory_range dynamically.
Thanks
Zou Nan hai
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-02-01 2:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-01 1:54 [PATCH] IA64 kexec-tools: efi_memmap overflow on large systems Jay Lan
2007-02-01 2:43 ` Zou, Nanhai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox