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: Clip memory not usable by Mini-OS

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] minios: Clip memory not usable by Mini-OS (above 1GB)
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 06 Dec 2008 04:20:41 -0800
Delivery-date: Sat, 06 Dec 2008 04:24:22 -0800
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 1228482417 0
# Node ID 4ffd935c08a3e88fa67328efc4f7bbdbce4a162b
# Parent  eed39afde7dd52d623d8c1a0f659507ac630d9fc
minios: Clip memory not usable by Mini-OS (above 1GB)

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

diff -r eed39afde7dd -r 4ffd935c08a3 extras/mini-os/arch/x86/mm.c
--- a/extras/mini-os/arch/x86/mm.c      Fri Dec 05 13:03:44 2008 +0000
+++ b/extras/mini-os/arch/x86/mm.c      Fri Dec 05 13:06:57 2008 +0000
@@ -420,7 +420,9 @@ static unsigned long demand_map_area_sta
 #define DEMAND_MAP_PAGES ((2ULL << 30) / PAGE_SIZE)
 #endif
 
-#ifdef HAVE_LIBC
+#ifndef HAVE_LIBC
+#define HEAP_PAGES 0
+#else
 unsigned long heap, brk, heap_mapped, heap_end;
 #ifdef __x86_64__
 #define HEAP_PAGES ((128ULL << 30) / PAGE_SIZE)
@@ -591,7 +593,7 @@ void arch_init_mm(unsigned long* start_p
 void arch_init_mm(unsigned long* start_pfn_p, unsigned long* max_pfn_p)
 {
 
-    unsigned long start_pfn, max_pfn;
+    unsigned long start_pfn, max_pfn, virt_pfns;
 
     printk("  _text:        %p\n", &_text);
     printk("  _etext:       %p\n", &_etext);
@@ -604,7 +606,12 @@ void arch_init_mm(unsigned long* start_p
     start_pfn = PFN_UP(to_phys(start_info.pt_base)) + 
                 start_info.nr_pt_frames + 3;
     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);
+
     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: Clip memory not usable by Mini-OS (above 1GB), Xen patchbot-unstable <=