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] minios: Fix 18874 memory clipping

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] minios: Fix 18874 memory clipping
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 09 Mar 2009 04:30:10 -0700
Delivery-date: Mon, 09 Mar 2009 04:30:31 -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 1236588191 0
# Node ID 5a981686bbf85f686bbf9f1e5f77e7da72200f8a
# Parent  dd489125a2e7718efa0e7afe89e7875d7909353f
minios: Fix 18874 memory clipping

Fix 18874's memory clipping: there are three page-sized holes between
direct mapping, demand mapping, heap pages and the end of memory.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
---
 extras/mini-os/arch/x86/mm.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff -r dd489125a2e7 -r 5a981686bbf8 extras/mini-os/arch/x86/mm.c
--- a/extras/mini-os/arch/x86/mm.c      Fri Mar 06 19:18:39 2009 +0000
+++ b/extras/mini-os/arch/x86/mm.c      Mon Mar 09 08:43:11 2009 +0000
@@ -778,8 +778,7 @@ void arch_init_p2m(unsigned long max_pfn
 
 void arch_init_mm(unsigned long* start_pfn_p, unsigned long* max_pfn_p)
 {
-
-    unsigned long start_pfn, max_pfn, virt_pfns;
+    unsigned long start_pfn, max_pfn;
 
     printk("      _text: %p(VA)\n", &_text);
     printk("     _etext: %p(VA)\n", &_etext);
@@ -794,9 +793,13 @@ void arch_init_mm(unsigned long* start_p
     max_pfn = start_info.nr_pages;
 
     /* We need room for demand mapping and heap, clip available memory */
-    virt_pfns = DEMAND_MAP_PAGES + HEAP_PAGES;
-    if ( max_pfn + virt_pfns + 1 < max_pfn )
-        max_pfn = -(virt_pfns + 1);
+#if defined(__i386__)
+    {
+        unsigned long virt_pfns = 1 + DEMAND_MAP_PAGES + 1 + HEAP_PAGES;
+        if (max_pfn + virt_pfns >= 0x100000)
+            max_pfn = 0x100000 - virt_pfns - 1;
+    }
+#endif
 
     printk("  start_pfn: %lx\n", start_pfn);
     printk("    max_pfn: %lx\n", max_pfn);

_______________________________________________
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] minios: Fix 18874 memory clipping, Xen patchbot-unstable <=