Skip to content

Commit 9d2f86c

Browse files
Alex Thorltonjgross1
authored andcommitted
x86: Make E820_X_MAX unconditionally larger than E820MAX
It's really not necessary to limit E820_X_MAX to 128 in the non-EFI case. This commit drops E820_X_MAX's dependency on CONFIG_EFI, so that E820_X_MAX is always at least slightly larger than E820MAX. The real motivation behind this is actually to prevent some issues in the Xen kernel, where the XENMEM_machine_memory_map hypercall can produce an e820 map larger than 128 entries, even on systems where the original e820 table was quite a bit smaller than that, depending on how many IOAPICs are installed on the system. Signed-off-by: Alex Thorlton <athorlton@sgi.com> Suggested-by: Ingo Molnar <mingo@redhat.com> Acked-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent 577f79e commit 9d2f86c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

arch/x86/include/asm/e820.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
#ifndef _ASM_X86_E820_H
22
#define _ASM_X86_E820_H
33

4-
#ifdef CONFIG_EFI
4+
/*
5+
* E820_X_MAX is the maximum size of the extended E820 table. The extended
6+
* table may contain up to 3 extra E820 entries per possible NUMA node, so we
7+
* make room for 3 * MAX_NUMNODES possible entries, beyond the standard 128.
8+
* Also note that E820_X_MAX *must* be defined before we include uapi/asm/e820.h.
9+
*/
510
#include <linux/numa.h>
611
#define E820_X_MAX (E820MAX + 3 * MAX_NUMNODES)
7-
#else /* ! CONFIG_EFI */
8-
#define E820_X_MAX E820MAX
9-
#endif
12+
1013
#include <uapi/asm/e820.h>
14+
1115
#ifndef __ASSEMBLY__
1216
/* see comment in arch/x86/kernel/e820.c */
1317
extern struct e820map *e820;

0 commit comments

Comments
 (0)