aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Jackson <pj@sgi.com>2008-05-14 11:15:40 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-25 04:55:11 -0400
commit028b785888c523baccdf27af0cdbf1deb92edec0 (patch)
tree7a5ae30398b16fe3b7d7fcb13eb46776917e43b1
parentc3965bd15118742d72b4bc1a290d37b3f081eb98 (diff)
x86 boot: extend some internal memory map arrays to handle larger EFI input
Extend internal boot time memory tables to allow for up to three entries per node, which may be larger than the 128 E820MAX entries handled by the legacy BIOS E820 interface. The EFI interface, if present, is capable of passing memory map entries for these larger node counts. This patch requires an earlier patch that rewrote code depending on these array sizes from using E820MAX explicitly to size loops, to instead using ARRAY_SIZE() of the applicable array. Another patch following this one will provide the code to pick up additional memory entries passed via the EFI interface from the BIOS and insert them in the following, now enlarged, arrays. Signed-off-by: Paul Jackson <pj@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/e820.c8
-rw-r--r--include/asm-x86/e820.h37
2 files changed, 40 insertions, 5 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 2396b9da8027..3f7777b255aa 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -149,10 +149,10 @@ int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map,
149 struct e820entry *pbios; /* pointer to original bios entry */ 149 struct e820entry *pbios; /* pointer to original bios entry */
150 unsigned long long addr; /* address for this change point */ 150 unsigned long long addr; /* address for this change point */
151 }; 151 };
152 static struct change_member change_point_list[2*E820MAX] __initdata; 152static struct change_member change_point_list[2*E820_X_MAX] __initdata;
153 static struct change_member *change_point[2*E820MAX] __initdata; 153static struct change_member *change_point[2*E820_X_MAX] __initdata;
154 static struct e820entry *overlap_list[E820MAX] __initdata; 154static struct e820entry *overlap_list[E820_X_MAX] __initdata;
155 static struct e820entry new_bios[E820MAX] __initdata; 155static struct e820entry new_bios[E820_X_MAX] __initdata;
156 struct change_member *change_tmp; 156 struct change_member *change_tmp;
157 unsigned long current_type, last_type; 157 unsigned long current_type, last_type;
158 unsigned long long last_addr; 158 unsigned long long last_addr;
diff --git a/include/asm-x86/e820.h b/include/asm-x86/e820.h
index 65c891d2a4cb..ab18457a95c0 100644
--- a/include/asm-x86/e820.h
+++ b/include/asm-x86/e820.h
@@ -2,6 +2,41 @@
2#define __ASM_E820_H 2#define __ASM_E820_H
3#define E820MAP 0x2d0 /* our map */ 3#define E820MAP 0x2d0 /* our map */
4#define E820MAX 128 /* number of entries in E820MAP */ 4#define E820MAX 128 /* number of entries in E820MAP */
5
6/*
7 * Legacy E820 BIOS limits us to 128 (E820MAX) nodes due to the
8 * constrained space in the zeropage. If we have more nodes than
9 * that, and if we've booted off EFI firmware, then the EFI tables
10 * passed us from the EFI firmware can list more nodes. Size our
11 * internal memory map tables to have room for these additional
12 * nodes, based on up to three entries per node for which the
13 * kernel was built: MAX_NUMNODES == (1 << CONFIG_NODES_SHIFT),
14 * plus E820MAX, allowing space for the possible duplicate E820
15 * entries that might need room in the same arrays, prior to the
16 * call to sanitize_e820_map() to remove duplicates. The allowance
17 * of three memory map entries per node is "enough" entries for
18 * the initial hardware platform motivating this mechanism to make
19 * use of additional EFI map entries. Future platforms may want
20 * to allow more than three entries per node or otherwise refine
21 * this size.
22 */
23
24/*
25 * Odd: 'make headers_check' complains about numa.h if I try
26 * to collapse the next two #ifdef lines to a single line:
27 * #if defined(__KERNEL__) && defined(CONFIG_EFI)
28 */
29#ifdef __KERNEL__
30#ifdef CONFIG_EFI
31#include <linux/numa.h>
32#define E820_X_MAX (E820MAX + 3 * MAX_NUMNODES)
33#else /* ! CONFIG_EFI */
34#define E820_X_MAX E820MAX
35#endif
36#else /* ! __KERNEL__ */
37#define E820_X_MAX E820MAX
38#endif
39
5#define E820NR 0x1e8 /* # entries in E820MAP */ 40#define E820NR 0x1e8 /* # entries in E820MAP */
6 41
7#define E820_RAM 1 42#define E820_RAM 1
@@ -18,7 +53,7 @@ struct e820entry {
18 53
19struct e820map { 54struct e820map {
20 __u32 nr_map; 55 __u32 nr_map;
21 struct e820entry map[E820MAX]; 56 struct e820entry map[E820_X_MAX];
22}; 57};
23 58
24extern struct e820map e820; 59extern struct e820map e820;