With a large number of CPUs, the amount of memory needed to construct the vCPU structures for Dom0 becomes significant and hence should be accounted for when calculating the amount of memory to pass to Dom0. Signed-off-by: Jan Beulich --- 2010-03-09.orig/xen/arch/x86/domain_build.c 2010-03-09 00:00:00.000000000 +0100 +++ 2010-03-09/xen/arch/x86/domain_build.c 2010-03-10 16:49:52.000000000 +0100 @@ -155,6 +155,13 @@ static unsigned long __init compute_dom0 unsigned long min_pages = dom0_min_nrpages; unsigned long max_pages = dom0_max_nrpages; + avail -= (opt_dom0_max_vcpus - 1UL) + << get_order_from_bytes(sizeof(struct vcpu)); +#ifdef __x86_64__ + if ( sizeof_long == sizeof(int) ) + avail -= opt_dom0_max_vcpus - 1; +#endif + /* * If domain 0 allocation isn't specified, reserve 1/16th of available * memory for things like DMA buffers. This reservation is clamped to