[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 3/3] xen/x86: support larger memory map from EFI



Use a larger e820 map buffer for non-BIOS memory map sources. This
requires to have different defines for the maximum number of E820 map
entries for the raw BIOS buffer and the later used struct e820map.

While at it use e820.h in mem.S in order to avoid having to define the
buffer size at two places.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
 xen/arch/x86/boot/mem.S    | 7 ++++---
 xen/arch/x86/setup.c       | 2 +-
 xen/include/asm-x86/e820.h | 7 ++++++-
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/mem.S b/xen/arch/x86/boot/mem.S
index 602ab2c..17db546 100644
--- a/xen/arch/x86/boot/mem.S
+++ b/xen/arch/x86/boot/mem.S
@@ -1,7 +1,8 @@
+#include <asm/e820.h>
+
         .code16
 
 #define SMAP    0x534d4150
-#define E820MAX 128
 
 get_memory_map:
 
@@ -23,7 +24,7 @@ get_memory_map:
         jne     .Lmem88
 
         movb    bootsym(e820nr),%al             # up to 128 entries
-        cmpb    $E820MAX,%al
+        cmpb    $E820_BIOS_MAX,%al
         jae     .Lmem88
 
         incb    bootsym(e820nr)
@@ -69,7 +70,7 @@ get_memory_map:
 
         .align  4
 GLOBAL(e820map)
-        .fill   E820MAX*20,1,0
+        .fill   E820_BIOS_MAX*20,1,0
 GLOBAL(e820nr)
         .long   0
 GLOBAL(lowmem_kb)
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index d7ee678..36c73f4 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -785,7 +785,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     else if ( e820_bios_nr != 0 )
     {
         memmap_type = "Xen-e820";
-        for ( i = 0; i < e820_bios_nr && i < E820MAX; i++ )
+        for ( i = 0; i < e820_bios_nr && i < E820_BIOS_MAX; i++ )
             e820_raw.map[i] = e820_bios[i];
         e820_raw.nr_map = i;
     }
diff --git a/xen/include/asm-x86/e820.h b/xen/include/asm-x86/e820.h
index 4a40d14..448338c 100644
--- a/xen/include/asm-x86/e820.h
+++ b/xen/include/asm-x86/e820.h
@@ -10,13 +10,14 @@
 #define E820_NVS          4
 #define E820_UNUSABLE     5
 
+#ifndef __ASSEMBLY__
 struct __packed e820entry {
     uint64_t addr;
     uint64_t size;
     uint32_t type;
 };
 
-#define E820MAX        128
+#define E820MAX        1024
 
 struct e820map {
     unsigned int nr_map;
@@ -42,4 +43,8 @@ extern unsigned int lowmem_kb, highmem_kb;
 #define e820_bios bootsym(e820map)
 #define e820_bios_nr bootsym(e820nr)
 
+#endif /* __ASSEMBLY__ */
+
+#define E820_BIOS_MAX 128
+
 #endif /*__E820_HEADER*/
-- 
2.10.2


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.