aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-02-12 09:24:18 +0000
committerKeir Fraser <keir.fraser@citrix.com>2010-02-12 09:24:18 +0000
commit6391c33d794a072adf5c07fb0826f0a1c874b30b (patch)
tree347e645e219bc22a74227c6372b4f6840617ec8c
parent70d0560287642c0323f3566d8c998d907c52d7d7 (diff)
downloadxen-6391c33d794a072adf5c07fb0826f0a1c874b30b.tar.gz
xen-6391c33d794a072adf5c07fb0826f0a1c874b30b.tar.bz2
xen-6391c33d794a072adf5c07fb0826f0a1c874b30b.zip
x86_64: widen bit width usable for struct domain allocation
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@novell.com>
-rw-r--r--xen/arch/x86/domain.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 64251eedf8..0ead1a1985 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -174,11 +174,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;