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

[Xen-changelog] [xen-unstable] [LINUX] Provide permanent global version of machine_e820 map for



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 1adaf06e8abcdb69ef8f537eebfdf2b7a9abf763
# Parent  affbab70fca28b6ab6bb483bc149543c21aa2617
[LINUX] Provide permanent global version of machine_e820 map for
general use.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c   |   21 +++++++++--------
 linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c |   24 ++++++++++----------
 2 files changed, 23 insertions(+), 22 deletions(-)

diff -r affbab70fca2 -r 1adaf06e8abc 
linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Wed Sep 20 18:41:44 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Thu Sep 21 09:37:03 
2006 +0100
@@ -156,6 +156,9 @@ EXPORT_SYMBOL(ist_info);
 EXPORT_SYMBOL(ist_info);
 #endif
 struct e820map e820;
+#ifdef CONFIG_XEN
+struct e820map machine_e820;
+#endif
 
 extern void early_cpu_init(void);
 extern void generic_apic_probe(char *);
@@ -1451,7 +1454,6 @@ static void __init register_memory(void)
 static void __init register_memory(void)
 {
 #ifdef CONFIG_XEN
-       struct e820entry *machine_e820;
        struct xen_memory_map memmap;
 #endif
        int           i;
@@ -1461,14 +1463,14 @@ static void __init register_memory(void)
                return;
 
 #ifdef CONFIG_XEN
-       machine_e820 = alloc_bootmem_low_pages(PAGE_SIZE);
-
        memmap.nr_entries = E820MAX;
-       set_xen_guest_handle(memmap.buffer, machine_e820);
-
-       BUG_ON(HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap));
-
-       legacy_init_iomem_resources(machine_e820, memmap.nr_entries,
+       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;
+
+       legacy_init_iomem_resources(machine_e820.map, machine_e820.nr_map,
                                    &code_resource, &data_resource);
 #else
        if (efi_enabled)
@@ -1486,8 +1488,7 @@ static void __init register_memory(void)
                request_resource(&ioport_resource, &standard_io_resources[i]);
 
 #ifdef CONFIG_XEN
-       e820_setup_gap(machine_e820, memmap.nr_entries);
-       free_bootmem(__pa(machine_e820), PAGE_SIZE);
+       e820_setup_gap(machine_e820.map, machine_e820.nr_map);
 #else
        e820_setup_gap(e820.map, e820.nr_map);
 #endif
diff -r affbab70fca2 -r 1adaf06e8abc 
linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c       Wed Sep 20 
18:41:44 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c       Thu Sep 21 
09:37:03 2006 +0100
@@ -144,6 +144,9 @@ struct sys_desc_table_struct {
 
 struct edid_info edid_info;
 struct e820map e820;
+#ifdef CONFIG_XEN
+struct e820map machine_e820;
+#endif
 
 extern int root_mountflags;
 
@@ -626,7 +629,6 @@ void __init setup_arch(char **cmdline_p)
 void __init setup_arch(char **cmdline_p)
 {
        unsigned long kernel_end;
-       struct e820entry *machine_e820;
        struct xen_memory_map memmap;
 
 #ifdef CONFIG_XEN
@@ -919,14 +921,14 @@ void __init setup_arch(char **cmdline_p)
        probe_roms();
 #ifdef CONFIG_XEN
        if (is_initial_xendomain()) {
-               machine_e820 = alloc_bootmem_low_pages(PAGE_SIZE);
-
                memmap.nr_entries = E820MAX;
-               set_xen_guest_handle(memmap.buffer, machine_e820);
-
-               BUG_ON(HYPERVISOR_memory_op(XENMEM_machine_memory_map, 
&memmap));
-
-               e820_reserve_resources(machine_e820, memmap.nr_entries);
+               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;
+
+               e820_reserve_resources(machine_e820.map, machine_e820.nr_map);
        }
 #else
        e820_reserve_resources(e820.map, e820.nr_map);
@@ -942,10 +944,8 @@ void __init setup_arch(char **cmdline_p)
        }
 
 #ifdef CONFIG_XEN
-       if (is_initial_xendomain()) {
-               e820_setup_gap(machine_e820, memmap.nr_entries);
-               free_bootmem(__pa(machine_e820), PAGE_SIZE);
-       }
+       if (is_initial_xendomain())
+               e820_setup_gap(machine_e820.map, machine_e820.nr_map);
 #else
        e820_setup_gap(e820.map, e820.nr_map);
 #endif

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


 


Rackspace

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