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] x86_64: widen bit width usable for struct domain all

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86_64: widen bit width usable for struct domain allocation
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Fri, 12 Feb 2010 08:05:25 +0000
Delivery-date: Fri, 12 Feb 2010 00:05:46 -0800
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
With it being a PDX (instead of a PFN) that gets stored when a 32-bit
quantity is needed, we should also account for the bits removed during
PFN-to-PDX conversion when doing the allocation.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- 2010-02-09.orig/xen/arch/x86/domain.c       2010-02-09 00:00:00.000000000 
+0100
+++ 2010-02-09/xen/arch/x86/domain.c    2010-02-12 08:44:01.000000000 +0100
@@ -183,11 +183,15 @@ struct domain *alloc_domain_struct(void)
 {
     struct domain *d;
     /*
-     * We pack the MFN of the domain structure into a 32-bit field within
+     * We pack the PDX of the domain structure into a 32-bit field within
      * the page_info structure. Hence the MEMF_bits() restriction.
      */
-    d = alloc_xenheap_pages(
-        get_order_from_bytes(sizeof(*d)), MEMF_bits(32 + PAGE_SHIFT));
+    unsigned int bits = 32 + PAGE_SHIFT;
+
+#ifdef __x86_64__
+    bits += pfn_pdx_hole_shift;
+#endif
+    d = alloc_xenheap_pages(get_order_from_bytes(sizeof(*d)), MEMF_bits(bits));
     if ( d != NULL )
         memset(d, 0, sizeof(*d));
     return d;



Attachment: x86-widen-domain-struct-bits.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86_64: widen bit width usable for struct domain allocation, Jan Beulich <=