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-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xen: Some cleanups for x86 start of day.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 May 2007 08:20:46 -0700
Delivery-date: Tue, 15 May 2007 08:24:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xen: Some cleanups for x86 start of day., Xen patchbot-unstable <=