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] x86: Improve e820 scanning for all I/O re

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Improve e820 scanning for all I/O regions.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 03 Jul 2007 13:33:59 -0700
Delivery-date: Tue, 03 Jul 2007 13:32:16 -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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1183460551 -3600
# Node ID 08bcc54aee8e3c24cab2f0df97179c6ccfa86642
# Parent  eb2b7ce05f9769cb4761e4608cd990b4b8c9519c
x86: Improve e820 scanning for all I/O regions.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm.c |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff -r eb2b7ce05f97 -r 08bcc54aee8e xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Tue Jul 03 11:47:08 2007 +0100
+++ b/xen/arch/x86/mm.c Tue Jul 03 12:02:31 2007 +0100
@@ -211,23 +211,37 @@ void __init arch_init_memory(void)
         share_xen_page_with_guest(mfn_to_page(i), dom_io, XENSHARE_writable);
  
     /* Any areas not specified as RAM by the e820 map are considered I/O. */
-    for ( i = 0, pfn = 0; i < e820.nr_map; i++ )
-    {
-        if ( e820.map[i].type != E820_RAM )
-            continue;
-        /* Every page from cursor to start of next RAM region is I/O. */
-        rstart_pfn = PFN_UP(e820.map[i].addr);
-        rend_pfn   = PFN_DOWN(e820.map[i].addr + e820.map[i].size);
+    pfn = i = 0;
+    while ( pfn < max_page )
+    {
+        while ( (i < e820.nr_map) && (e820.map[i].type != E820_RAM) )
+            i++;
+
+        if ( i == e820.nr_map )
+        {
+            /* No more RAM regions: mark as I/O right to end of memory map. */
+            rstart_pfn = rend_pfn = max_page;
+        }
+        else
+        {
+            /* Mark as I/O just up as far as next RAM region. */
+            rstart_pfn = min_t(unsigned long, max_page,
+                               PFN_UP(e820.map[i].addr));
+            rend_pfn   = max_t(unsigned long, rstart_pfn,
+                               PFN_DOWN(e820.map[i].addr + e820.map[i].size));
+        }
+
+        /* Mark as I/O up to next RAM region. */
         for ( ; pfn < rstart_pfn; pfn++ )
         {
             BUG_ON(!mfn_valid(pfn));
             share_xen_page_with_guest(
                 mfn_to_page(pfn), dom_io, XENSHARE_writable);
         }
+
         /* Skip the RAM region. */
         pfn = rend_pfn;
     }
-    BUG_ON(pfn != max_page);
 
     subarch_init_memory();
 }

_______________________________________________
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] x86: Improve e820 scanning for all I/O regions., Xen patchbot-unstable <=