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-4.0-testing] x86: Revert how we calculate 'total sy

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] x86: Revert how we calculate 'total system RAM' after c/s 20236.
From: "Xen patchbot-4.0-testing" <patchbot-4.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Apr 2010 09:50:18 -0700
Delivery-date: Mon, 19 Apr 2010 07:24:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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.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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] x86: Revert how we calculate 'total system RAM' after c/s 20236., Xen patchbot-4.0-testing <=