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

[Xen-changelog] [xen-unstable] xen: Some cleanups for x86 start of day.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1178834083 -3600
# Node ID e19ddfa781c5f9c8c4e30b63baf12d3cdefc4e0e
# Parent  16319e70f77d17b3524b6e02cca1a88e7515ed3c
xen: Some cleanups for x86 start of day.
1. Remove erroneous modification to e820.c
2. Make sure Xen is relocated as high as possible below 4GB.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/e820.c  |    2 +-
 xen/arch/x86/setup.c |   27 ++++++++++++---------------
 2 files changed, 13 insertions(+), 16 deletions(-)

diff -r 16319e70f77d -r e19ddfa781c5 xen/arch/x86/e820.c
--- a/xen/arch/x86/e820.c       Thu May 10 19:35:25 2007 +0100
+++ b/xen/arch/x86/e820.c       Thu May 10 22:54:43 2007 +0100
@@ -32,7 +32,7 @@ static void __init add_memory_region(uns
     }
 } /* add_memory_region */
 
-/*static*/ void __init print_e820_memory_map(struct e820entry *map, int 
entries)
+static void __init print_e820_memory_map(struct e820entry *map, int entries)
 {
     int i;
 
diff -r 16319e70f77d -r e19ddfa781c5 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Thu May 10 19:35:25 2007 +0100
+++ b/xen/arch/x86/setup.c      Thu May 10 22:54:43 2007 +0100
@@ -462,7 +462,7 @@ void __init __start_xen(multiboot_info_t
     }
 
     /*
-     * Iterate over all superpage-aligned RAM regions.
+     * Iterate backwards over all superpage-aligned RAM regions.
      * 
      * We require superpage alignment because the boot allocator is not yet
      * initialised. Hence we can only map superpages in the address range
@@ -475,7 +475,7 @@ void __init __start_xen(multiboot_info_t
      * x86/64, we relocate Xen to higher memory.
      */
     modules_length = mod[mbi->mods_count-1].mod_end - mod[0].mod_start;
-    for ( i = 0; i < boot_e820.nr_map; i++ )
+    for ( i = boot_e820.nr_map-1; i >= 0; i-- )
     {
         uint64_t s, e, mask = (1UL << L2_PAGETABLE_SHIFT) - 1;
 
@@ -490,19 +490,6 @@ void __init __start_xen(multiboot_info_t
         map_pages_to_xen(
             (unsigned long)maddr_to_bootstrap_virt(s),
             s >> PAGE_SHIFT, (e-s) >> PAGE_SHIFT, PAGE_HYPERVISOR);
-
-        /* Is the region suitable for relocating the multiboot modules? */
-        if ( !initial_images_start && ((e-s) >= modules_length) )
-        {
-            e -= modules_length;
-            e &= ~mask;
-            initial_images_start = e;
-            initial_images_end = initial_images_start + modules_length;
-            move_memory(initial_images_start, 
-                        mod[0].mod_start, mod[mbi->mods_count-1].mod_end);
-            if ( s >= e )
-                continue;
-        }
 
 #if defined(CONFIG_X86_64)
         /* Is the region suitable for relocating Xen? */
@@ -571,6 +558,16 @@ void __init __start_xen(multiboot_info_t
                 "D" (__va(__pa(cpu0_stack))), "c" (STACK_SIZE) : "memory" );
         }
 #endif
+
+        /* Is the region suitable for relocating the multiboot modules? */
+        if ( !initial_images_start && (s < e) && ((e-s) >= modules_length) )
+        {
+            e -= modules_length;
+            initial_images_start = e;
+            initial_images_end = initial_images_start + modules_length;
+            move_memory(initial_images_start, 
+                        mod[0].mod_start, mod[mbi->mods_count-1].mod_end);
+        }
     }
 
     if ( !initial_images_start )

_______________________________________________
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®.