aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/xen')
-rw-r--r--arch/x86/xen/smp.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index acd9b6705e02..2cce362c9874 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -158,7 +158,7 @@ static void __init xen_fill_possible_map(void)
158{ 158{
159 int i, rc; 159 int i, rc;
160 160
161 for (i = 0; i < NR_CPUS; i++) { 161 for (i = 0; i < nr_cpu_ids; i++) {
162 rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL); 162 rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL);
163 if (rc >= 0) { 163 if (rc >= 0) {
164 num_processors++; 164 num_processors++;
@@ -196,7 +196,7 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus)
196 196
197 /* Restrict the possible_map according to max_cpus. */ 197 /* Restrict the possible_map according to max_cpus. */
198 while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) { 198 while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) {
199 for (cpu = NR_CPUS - 1; !cpu_possible(cpu); cpu--) 199 for (cpu = nr_cpu_ids - 1; !cpu_possible(cpu); cpu--)
200 continue; 200 continue;
201 cpu_clear(cpu, cpu_possible_map); 201 cpu_clear(cpu, cpu_possible_map);
202 } 202 }
@@ -408,24 +408,22 @@ static void xen_smp_send_reschedule(int cpu)
408 xen_send_IPI_one(cpu, XEN_RESCHEDULE_VECTOR); 408 xen_send_IPI_one(cpu, XEN_RESCHEDULE_VECTOR);
409} 409}
410 410
411static void xen_send_IPI_mask(cpumask_t mask, enum ipi_vector vector) 411static void xen_send_IPI_mask(const cpumask_t *mask, enum ipi_vector vector)
412{ 412{
413 unsigned cpu; 413 unsigned cpu;
414 414
415 cpus_and(mask, mask, cpu_online_map); 415 for_each_cpu_and(cpu, mask, &cpu_online_map)
416
417 for_each_cpu_mask_nr(cpu, mask)
418 xen_send_IPI_one(cpu, vector); 416 xen_send_IPI_one(cpu, vector);
419} 417}
420 418
421static void xen_smp_send_call_function_ipi(cpumask_t mask) 419static void xen_smp_send_call_function_ipi(const cpumask_t *mask)
422{ 420{
423 int cpu; 421 int cpu;
424 422
425 xen_send_IPI_mask(mask, XEN_CALL_FUNCTION_VECTOR); 423 xen_send_IPI_mask(mask, XEN_CALL_FUNCTION_VECTOR);
426 424
427 /* Make sure other vcpus get a chance to run if they need to. */ 425 /* Make sure other vcpus get a chance to run if they need to. */
428 for_each_cpu_mask_nr(cpu, mask) { 426 for_each_cpu_mask_nr(cpu, *mask) {
429 if (xen_vcpu_stolen(cpu)) { 427 if (xen_vcpu_stolen(cpu)) {
430 HYPERVISOR_sched_op(SCHEDOP_yield, 0); 428 HYPERVISOR_sched_op(SCHEDOP_yield, 0);
431 break; 429 break;
@@ -435,7 +433,8 @@ static void xen_smp_send_call_function_ipi(cpumask_t mask)
435 433
436static void xen_smp_send_call_function_single_ipi(int cpu) 434static void xen_smp_send_call_function_single_ipi(int cpu)
437{ 435{
438 xen_send_IPI_mask(cpumask_of_cpu(cpu), XEN_CALL_FUNCTION_SINGLE_VECTOR); 436 xen_send_IPI_mask(&cpumask_of_cpu(cpu),
437 XEN_CALL_FUNCTION_SINGLE_VECTOR);
439} 438}
440 439
441static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id) 440static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id)