xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	andrew.cooper3@citrix.com, daniel.kiper@oracle.com,
	alex.thorlton@hpe.com, jbeulich@suse.com
Subject: [PATCH 3/3] xen/x86: support larger memory map from EFI
Date: Tue, 21 Mar 2017 14:10:23 +0100	[thread overview]
Message-ID: <20170321131023.26810-4-jgross@suse.com> (raw)
In-Reply-To: <20170321131023.26810-1-jgross@suse.com>

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@suse.com>
---
 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@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-03-21 13:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 13:10 [PATCH 0/3] xen: support of large memory maps Juergen Gross
2017-03-21 13:10 ` [PATCH 1/3] xen/x86: split boot trampoline into permanent and temporary part Juergen Gross
2017-03-22 11:33   ` Jan Beulich
     [not found]   ` <58D26F070200007800146281@suse.com>
2017-03-22 11:50     ` Juergen Gross
2017-03-21 13:10 ` [PATCH 2/3] xen/x86: use trampoline e820 buffer for BIOS interface only Juergen Gross
2017-03-22 13:12   ` Jan Beulich
     [not found]   ` <58D2865F02000078001463C2@suse.com>
2017-03-22 15:01     ` Juergen Gross
2017-03-22 15:23       ` Jan Beulich
     [not found]       ` <58D2A4EB0200007800146563@suse.com>
2017-03-22 15:25         ` Juergen Gross
2017-03-21 13:10 ` Juergen Gross [this message]
2017-03-22 13:19   ` [PATCH 3/3] xen/x86: support larger memory map from EFI Jan Beulich
     [not found]   ` <58D287DC02000078001463D8@suse.com>
2017-03-22 15:05     ` Juergen Gross
2017-03-21 13:26 ` [PATCH 0/3] xen: support of large memory maps Daniel Kiper
2017-03-22 15:17 ` Alex Thorlton
2017-03-22 15:22   ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170321131023.26810-4-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=alex.thorlton@hpe.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=daniel.kiper@oracle.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).