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

[Xen-changelog] [xen-unstable] x86_32: Respect e820 map when populating Xen heap.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1257754795 0
# Node ID 42e268da38b961ed8b9edf02308a8a85d4456bf3
# Parent  f8a320c333e8f06d573aaea5aa5bb466462840ff
x86_32: Respect e820 map when populating Xen heap.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/setup.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff -r f8a320c333e8 -r 42e268da38b9 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Mon Nov 09 08:03:30 2009 +0000
+++ b/xen/arch/x86/setup.c      Mon Nov 09 08:19:55 2009 +0000
@@ -931,8 +931,17 @@ void __init __start_xen(unsigned long mb
 
 #if defined(CONFIG_X86_32)
     /* Initialise the Xen heap. */
-    init_xenheap_pages(xenheap_initial_phys_start, xenheap_phys_end);
-    nr_pages = (xenheap_phys_end - xenheap_initial_phys_start) >> PAGE_SHIFT;
+    for ( nr_pages = i = 0; i < boot_e820.nr_map; i++ )
+    {
+        uint64_t s = boot_e820.map[i].addr;
+        uint64_t e = s + boot_e820.map[i].size;
+        s = max_t(uint64_t, s, xenheap_initial_phys_start);
+        e = min_t(uint64_t, e, xenheap_phys_end);
+        if ( (boot_e820.map[i].type != E820_RAM) || (s >= e) )
+            continue;
+        init_xenheap_pages(s, e);
+        nr_pages += (e - s) >> PAGE_SHIFT;
+    }
     printk("Xen heap: %luMB (%lukB)\n", 
            nr_pages >> (20 - PAGE_SHIFT),
            nr_pages << (PAGE_SHIFT - 10));

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