linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch 1/1] x86 efi: Fill all reserved memmap entries if add_efi_memmap specified.
@ 2010-05-12 18:10 Mike Travis
  2010-05-12 18:55 ` H. Peter Anvin
  0 siblings, 1 reply; 21+ messages in thread
From: Mike Travis @ 2010-05-12 18:10 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: x86, Yinghai Lu, Suresh Siddha, Rusty Russell, Jens Axboe,
	Jack Steiner, LKML


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@sgi.com>
Signed-off-by: Jack Steiner <steiner@sgi.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));

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2010-05-26 20:10 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-12 18:10 [Patch 1/1] x86 efi: Fill all reserved memmap entries if add_efi_memmap specified Mike Travis
2010-05-12 18:55 ` H. Peter Anvin
2010-05-12 20:19   ` Yinghai
2010-05-12 21:02     ` Mike Travis
2010-05-13 21:18       ` Mike Travis
2010-05-13 21:48         ` Yinghai
2010-05-13 21:55           ` Mike Travis
2010-05-13 22:46             ` H. Peter Anvin
2010-05-24 23:04               ` [Patch 1/1] x86 efi: insert add_efi_memmap entries into both e820 maps Mike Travis
2010-05-25 22:34               ` [Patch 1/1] x86 efi: Fill all reserved memmap entries if add_efi_memmap specified Mike Travis
2010-05-25 22:41                 ` H. Peter Anvin
2010-05-25 22:46                   ` Mike Travis
2010-05-25 22:49                     ` H. Peter Anvin
2010-05-26 17:39                     ` Yinghai Lu
2010-05-26 17:42                       ` Mike Travis
2010-05-26 18:22                         ` H. Peter Anvin
2010-05-26 18:47                           ` Mike Travis
2010-05-26 19:04                             ` H. Peter Anvin
2010-05-26 19:09                               ` Mike Travis
2010-05-26 20:10                                 ` H. Peter Anvin
2010-05-25 22:59                   ` [Patch 1/1] x86 efi: Fill all reserved memmap entries if add_efi_memmap specified v2 Mike Travis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).