WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] linux/x86: set up machine_e820 in copy_e820_map()

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux/x86: set up machine_e820 in copy_e820_map()
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Tue, 22 Apr 2008 14:24:28 +0100
Delivery-date: Tue, 22 Apr 2008 06:24:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
.. for it to be usable earlier (and also for being placed more
logically).

As usual, written and tested on 2.6.25 and made apply to the 2.6.18
tree without further testing.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: head-2008-04-02/arch/i386/kernel/setup-xen.c
===================================================================
--- head-2008-04-02.orig/arch/i386/kernel/setup-xen.c   2008-03-05 
15:22:37.000000000 +0100
+++ head-2008-04-02/arch/i386/kernel/setup-xen.c        2008-04-14 
10:44:52.000000000 +0200
@@ -736,6 +736,21 @@ int __init copy_e820_map(struct e820entr
 #endif
                add_memory_region(start, size, type);
        } while (biosmap++,--nr_map);
+
+#ifdef CONFIG_XEN
+       if (is_initial_xendomain()) {
+               struct xen_memory_map memmap;
+
+               memmap.nr_entries = E820MAX;
+               set_xen_guest_handle(memmap.buffer, machine_e820.map);
+
+               if (HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap))
+                       BUG();
+               machine_e820.nr_map = memmap.nr_entries;
+       } else
+               machine_e820 = e820;
+#endif
+
        return 0;
 }
 
@@ -1569,18 +1584,8 @@ void __init e820_register_memory(void)
 static void __init register_memory(void)
 {
 #ifdef CONFIG_XEN
-       if (is_initial_xendomain()) {
-               struct xen_memory_map memmap;
-
-               memmap.nr_entries = E820MAX;
-               set_xen_guest_handle(memmap.buffer, machine_e820.map);
-
-               if (HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap))
-                       BUG();
-
-               machine_e820.nr_map = memmap.nr_entries;
+       if (is_initial_xendomain())
                e820_setup_gap(machine_e820.map, machine_e820.nr_map);
-       }
        else
 #endif
                e820_setup_gap(e820.map, e820.nr_map);
Index: head-2008-04-02/arch/x86_64/kernel/e820-xen.c
===================================================================
--- head-2008-04-02.orig/arch/x86_64/kernel/e820-xen.c  2008-04-02 
15:00:51.000000000 +0200
+++ head-2008-04-02/arch/x86_64/kernel/e820-xen.c       2008-04-14 
10:45:51.000000000 +0200
@@ -604,6 +604,21 @@ static int __init copy_e820_map(struct e
 
                add_memory_region(start, size, type);
        } while (biosmap++,--nr_map);
+
+#ifdef CONFIG_XEN
+       if (is_initial_xendomain()) {
+               struct xen_memory_map memmap;
+
+               memmap.nr_entries = E820MAX;
+               set_xen_guest_handle(memmap.buffer, machine_e820.map);
+
+               if (HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap))
+                       BUG();
+               machine_e820.nr_map = memmap.nr_entries;
+       } else
+               machine_e820 = e820;
+#endif
+
        return 0;
 }
 
Index: head-2008-04-02/arch/x86_64/kernel/setup-xen.c
===================================================================
--- head-2008-04-02.orig/arch/x86_64/kernel/setup-xen.c 2008-04-08 
14:33:27.000000000 +0200
+++ head-2008-04-02/arch/x86_64/kernel/setup-xen.c      2008-04-14 
10:46:32.000000000 +0200
@@ -903,18 +903,8 @@ void __init setup_arch(char **cmdline_p)
         */
        probe_roms();
 #ifdef CONFIG_XEN
-       if (is_initial_xendomain()) {
-               struct xen_memory_map memmap;
-
-               memmap.nr_entries = E820MAX;
-               set_xen_guest_handle(memmap.buffer, machine_e820.map);
-
-               if (HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap))
-                       BUG();
-               machine_e820.nr_map = memmap.nr_entries;
-
+       if (is_initial_xendomain())
                e820_reserve_resources(machine_e820.map, machine_e820.nr_map);
-       }
 #else
        e820_reserve_resources(e820.map, e820.nr_map);
 #endif




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux/x86: set up machine_e820 in copy_e820_map(), Jan Beulich <=