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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1271355076 -3600
# Node ID 7ee8bb40200a1922d15036fd8788a364f8aaae8f
# Parent  d18e6a6c618af4f25a9e1a57c9e3eac55921678c
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/arch/x86/setup.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -r d18e6a6c618a -r 7ee8bb40200a xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Thu Apr 15 18:47:58 2010 +0100
+++ b/xen/arch/x86/setup.c      Thu Apr 15 19:11:16 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®.