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: Revert how we calculate 'total syste

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Revert how we calculate 'total system RAM' after c/s 20236.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Apr 2010 21:50:31 -0700
Delivery-date: Sun, 18 Apr 2010 11:06:00 -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 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

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