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-devel

[Xen-devel] [PATCH] Fix domheap structure allocation when NUMA=on

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Fix domheap structure allocation when NUMA=on
From: "Yang, Xiaowei" <xiaowei.yang@xxxxxxxxx>
Date: Fri, 20 Mar 2009 13:05:23 +0800
Delivery-date: Thu, 19 Mar 2009 22:06:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.19 (X11/20090105)
DIRECTMAP_VIRT_END can't be passed to virt_to_mfn(), as it's just beyond direct map boundary and triggers ASSERT very early at boot time.

Signed-off-by: Xiaowei Yang <xiaowei.yang@xxxxxxxxx>
diff -r 78ed606cb1ab xen/common/page_alloc.c
--- a/xen/common/page_alloc.c   Thu Mar 19 10:57:23 2009 +0800
+++ b/xen/common/page_alloc.c   Thu Mar 19 23:01:32 2009 +0800
@@ -293,7 +297,7 @@ static unsigned long init_node_heap(int 
     }
 #ifdef DIRECTMAP_VIRT_END
     else if ( nr >= needed &&
-              mfn + needed <= virt_to_mfn(DIRECTMAP_VIRT_END) )
+              mfn + needed <= virt_to_mfn(DIRECTMAP_VIRT_END - PAGE_SIZE) )
     {
         _heap[node] = mfn_to_virt(mfn);
         avail[node] = mfn_to_virt(mfn + needed) - sizeof(**avail) * NR_ZONES;
diff -r 78ed606cb1ab xen/include/asm-x86/x86_64/page.h
--- a/xen/include/asm-x86/x86_64/page.h Thu Mar 19 10:57:23 2009 +0800
+++ b/xen/include/asm-x86/x86_64/page.h Thu Mar 19 23:00:26 2009 +0800
@@ -40,7 +40,7 @@ static inline unsigned long __virt_to_ma
     ASSERT(va >= XEN_VIRT_START);
     ASSERT(va < DIRECTMAP_VIRT_END);
     ASSERT((va < XEN_VIRT_END) || (va >= DIRECTMAP_VIRT_START));
-    if ( va > DIRECTMAP_VIRT_START )
+    if ( va >= DIRECTMAP_VIRT_START )
         return va - DIRECTMAP_VIRT_START;
     return va - XEN_VIRT_START + xen_phys_start;
 }
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel