From akpm@osdl.org Thu Jun 1 20:34:51 2006 Message-Id: <200606020334.k523YhiM029108@shell0.pdx.osdl.net> From: Vivek Goyal Subject: i386: export memory more than 4G through /proc/iomem To: greg@kroah.com Cc: akpm@osdl.org, vgoyal@in.ibm.com, maneesh@in.ibm.com Date: Thu, 01 Jun 2006 20:39:02 -0700 From: Vivek Goyal Currently /proc/iomem exports physical memory also apart from io device memory. But on i386, it truncates any memory more than 4GB. This leads to problems for kexec/kdump. Kexec reads /proc/iomem to determine the system memory layout and prepares a memory map based on that and passes it to the kernel being kexeced. Given the fact that memory more than 4GB has been truncated, new kernel never gets to see and use that memory. Kdump also reads /proc/iomem to determine the physical memory layout of the system and encodes this informaiton in ELF headers. After a crash new kernel parses these ELF headers being used by previous kernel and vmcore is prepared accordingly. As memory more than 4GB has been truncated, kdump never sees that memory and never prepares ELF headers for it. Hence vmcore is truncated and limited to 4GB even if there is more physical memory in the system. This patch exports memory more than 4GB through /proc/iomem on i386. Cc: Maneesh Soni Cc: Vivek Goyal Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- arch/i386/kernel/setup.c | 2 ++ 1 file changed, 2 insertions(+) --- gregkh-2.6.orig/arch/i386/kernel/setup.c +++ gregkh-2.6/arch/i386/kernel/setup.c @@ -1314,8 +1314,10 @@ legacy_init_iomem_resources(struct resou probe_roms(); for (i = 0; i < e820.nr_map; i++) { struct resource *res; +#ifndef CONFIG_RESOURCES_64BIT if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL) continue; +#endif res = kzalloc(sizeof(struct resource), GFP_ATOMIC); switch (e820.map[i].type) { case E820_RAM: res->name = "System RAM"; break;