diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-05-14 20:37:02 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-05-14 20:37:02 +0100 |
commit | 7f01473211b2586130c653d3b1ac15acc082d4df (patch) | |
tree | 48cda4464ba8a8ff424e5c3d7dd9d0aa3a9fa9c3 /xen/common/domctl.c | |
parent | f9ffb1134c8be2f6bffd14578c179d3f12371abd (diff) | |
download | xen-7f01473211b2586130c653d3b1ac15acc082d4df.tar.gz xen-7f01473211b2586130c653d3b1ac15acc082d4df.tar.bz2 xen-7f01473211b2586130c653d3b1ac15acc082d4df.zip |
Remove many uses of cpu_possible_map and iterators over NR_CPUS.
The significant remaining culprits for x86 are credit2, hpet, and
percpu-area subsystems. To be dealt with in a separate patch.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/common/domctl.c')
-rw-r--r-- | xen/common/domctl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 259a6b28a5..7bc976eb79 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -155,7 +155,7 @@ static unsigned int default_vcpu0_location(cpumask_t *online) cpumask_t cpu_exclude_map; /* Do an initial CPU placement. Pick the least-populated CPU. */ - nr_cpus = last_cpu(cpu_possible_map) + 1; + nr_cpus = last_cpu(cpu_online_map) + 1; cnt = xmalloc_array(unsigned int, nr_cpus); if ( cnt ) { @@ -164,8 +164,9 @@ static unsigned int default_vcpu0_location(cpumask_t *online) rcu_read_lock(&domlist_read_lock); for_each_domain ( d ) for_each_vcpu ( d, v ) - if ( !test_bit(_VPF_down, &v->pause_flags) ) - cnt[v->processor]++; + if ( !test_bit(_VPF_down, &v->pause_flags) + && ((cpu = v->processor) < nr_cpus) ) + cnt[cpu]++; rcu_read_unlock(&domlist_read_lock); } |