debuggers.hg
changeset 20984:3bb163b74673
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>
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>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Fri Feb 12 09:24:18 2010 +0000 (2010-02-12) |
parents | a948403c8f99 |
children | 54c09c71fe47 |
files | xen/arch/x86/domain.c |
line diff
1.1 --- a/xen/arch/x86/domain.c Fri Feb 12 09:23:10 2010 +0000 1.2 +++ b/xen/arch/x86/domain.c Fri Feb 12 09:24:18 2010 +0000 1.3 @@ -174,11 +174,15 @@ struct domain *alloc_domain_struct(void) 1.4 { 1.5 struct domain *d; 1.6 /* 1.7 - * We pack the MFN of the domain structure into a 32-bit field within 1.8 + * We pack the PDX of the domain structure into a 32-bit field within 1.9 * the page_info structure. Hence the MEMF_bits() restriction. 1.10 */ 1.11 - d = alloc_xenheap_pages( 1.12 - get_order_from_bytes(sizeof(*d)), MEMF_bits(32 + PAGE_SHIFT)); 1.13 + unsigned int bits = 32 + PAGE_SHIFT; 1.14 + 1.15 +#ifdef __x86_64__ 1.16 + bits += pfn_pdx_hole_shift; 1.17 +#endif 1.18 + d = alloc_xenheap_pages(get_order_from_bytes(sizeof(*d)), MEMF_bits(bits)); 1.19 if ( d != NULL ) 1.20 memset(d, 0, sizeof(*d)); 1.21 return d;