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

[Xen-changelog] [xen-4.0-testing] x86: Revert how we calculate 'total system RAM' after c/s 20236.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1271355590 -3600
# Node ID 56fc712b36f3be75e9e7cd27893d102c4ff784db
# Parent  2b2e7b4e0267ff68b0ce035a493f063974a5e23d
x86: Revert how we calculate 'total system RAM' after c/s 20236.

This approach is more straightforward, in that it simply works the
original e820 map. It's what the user expects, and reporting a smaller
value is never appreciated. ;-)

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset:   21190:7ee8bb40200a
xen-unstable date:        Thu Apr 15 19:11:16 2010 +0100
---
 xen/arch/x86/setup.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -r 2b2e7b4e0267 -r 56fc712b36f3 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Thu Apr 15 19:19:13 2010 +0100
+++ b/xen/arch/x86/setup.c      Thu Apr 15 19:19:50 2010 +0100
@@ -822,7 +822,7 @@ void __init __start_xen(unsigned long mb
      * Walk every RAM region and map it in its entirety (on x86/64, at least)
      * and notify it to the boot allocator.
      */
-    for ( nr_pages = i = 0; i < boot_e820.nr_map; i++ )
+    for ( i = 0; i < boot_e820.nr_map; i++ )
     {
         uint64_t s, e, map_s, map_e, mask = PAGE_SIZE - 1;
 
@@ -897,11 +897,14 @@ void __init __start_xen(unsigned long mb
 
         /* Pass remainder of this memory chunk to the allocator. */
         init_boot_pages(map_s, e);
-        nr_pages += (e - s) >> PAGE_SHIFT;
     }
 
     memguard_init();
 
+    nr_pages = 0;
+    for ( i = 0; i < e820.nr_map; i++ )
+        if ( e820.map[i].type == E820_RAM )
+            nr_pages += e820.map[i].size >> PAGE_SHIFT;
     printk("System RAM: %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®.