[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4BEAEF10.9040809@sgi.com>
Date: Wed, 12 May 2010 11:10:24 -0700
From: Mike Travis <travis@....com>
To: Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>
CC: x86@...nel.org, Yinghai Lu <yinghai@...nel.org>,
Suresh Siddha <suresh.b.siddha@...el.com>,
Rusty Russell <rusty@...tcorp.com.au>,
Jens Axboe <jens.axboe@...cle.com>,
Jack Steiner <steiner@....com>,
LKML <linux-kernel@...r.kernel.org>
Subject: [Patch 1/1] x86 efi: Fill all reserved memmap entries if add_efi_memmap
specified.
Currently, the e820_reserve_resources() function does not add entries
obtained via the "add_efi_memmap" kernel cmdline option. This causes
/sys/firmware/memmap/... to be incomplete (stops after 128 entries).
Utilities that examine these entries then do not get the complete
picture of system memory.
This patch causes the above function to use the e820 memmap instead
of the e820_saved memmap if "add_efi_memmap" cmdline option is
specified.
Signed-off-by: Mike Travis <travis@....com>
Signed-off-by: Jack Steiner <steiner@....com>
---
arch/x86/include/asm/e820.h | 1 +
arch/x86/kernel/e820.c | 8 ++++++--
2 files changed, 7 insertions(+), 2 deletions(-)
--- linux.orig/arch/x86/include/asm/e820.h
+++ linux/arch/x86/include/asm/e820.h
@@ -89,6 +89,7 @@ extern int e820_search_gap(unsigned long
unsigned long start_addr, unsigned long long end_addr);
struct setup_data;
extern void parse_e820_ext(struct setup_data *data, unsigned long pa_data);
+extern int add_efi_memmap;
#if defined(CONFIG_X86_64) || \
(defined(CONFIG_X86_32) && defined(CONFIG_HIBERNATION))
--- linux.orig/arch/x86/kernel/e820.c
+++ linux/arch/x86/kernel/e820.c
@@ -1074,6 +1074,7 @@ void __init e820_reserve_resources(void)
int i;
struct resource *res;
u64 end;
+ struct e820map *e_map = &e820_saved;
res = alloc_bootmem(sizeof(struct resource) * e820.nr_map);
e820_res = res;
@@ -1101,8 +1102,11 @@ void __init e820_reserve_resources(void)
res++;
}
- for (i = 0; i < e820_saved.nr_map; i++) {
- struct e820entry *entry = &e820_saved.map[i];
+ if (add_efi_memmap)
+ e_map = &e820;
+
+ for (i = 0; i < e_map->nr_map; i++) {
+ struct e820entry *entry = &e_map->map[i];
firmware_map_add_early(entry->addr,
entry->addr + entry->size - 1,
e820_type_to_string(entry->type));
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists