ia64/xen-unstable

changeset 18298:d31546a3883e

x86: Reduce restrictions on dom0_max_vcpus.
Place a BUILD_BUG_ON() in mm.c to replace one of the restrictions.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Aug 08 11:22:44 2008 +0100 (2008-08-08)
parents f62a61cd95f5
children c386106f9638
files xen/arch/x86/domain_build.c xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/domain_build.c	Fri Aug 08 10:53:40 2008 +0100
     1.2 +++ b/xen/arch/x86/domain_build.c	Fri Aug 08 11:22:44 2008 +0100
     1.3 @@ -704,16 +704,12 @@ int __init construct_dom0(
     1.4  
     1.5      if ( opt_dom0_max_vcpus == 0 )
     1.6          opt_dom0_max_vcpus = num_online_cpus();
     1.7 -    if ( opt_dom0_max_vcpus > num_online_cpus() )
     1.8 -        opt_dom0_max_vcpus = num_online_cpus();
     1.9      if ( opt_dom0_max_vcpus > MAX_VIRT_CPUS )
    1.10          opt_dom0_max_vcpus = MAX_VIRT_CPUS;
    1.11 -    if ( opt_dom0_max_vcpus > BITS_PER_GUEST_LONG(d) )
    1.12 -        opt_dom0_max_vcpus = BITS_PER_GUEST_LONG(d);
    1.13      printk("Dom0 has maximum %u VCPUs\n", opt_dom0_max_vcpus);
    1.14  
    1.15      for ( i = 1; i < opt_dom0_max_vcpus; i++ )
    1.16 -        (void)alloc_vcpu(d, i, i);
    1.17 +        (void)alloc_vcpu(d, i, i % num_online_cpus());
    1.18  
    1.19      /* Set up CR3 value for write_ptbase */
    1.20      if ( paging_mode_enabled(v->domain) )
     2.1 --- a/xen/arch/x86/mm.c	Fri Aug 08 10:53:40 2008 +0100
     2.2 +++ b/xen/arch/x86/mm.c	Fri Aug 08 11:22:44 2008 +0100
     2.3 @@ -2218,6 +2218,12 @@ static inline cpumask_t vcpumask_to_pcpu
     2.4      cpumask_t    pmask = CPU_MASK_NONE;
     2.5      struct vcpu *v;
     2.6  
     2.7 +    /*
     2.8 +     * Callers copy only a single guest-sized longword from the guest.
     2.9 +     * This must be wide enough to reference all VCPUs. Worst case is 32 bits.
    2.10 +     */
    2.11 +    BUILD_BUG_ON(MAX_VIRT_CPUS > 32);
    2.12 +
    2.13      while ( vmask != 0 )
    2.14      {
    2.15          vcpu_id = find_first_set_bit(vmask);