|
@@ -207,8 +207,9 @@ static void xen_vcpu_setup(int cpu)
|
|
|
if (per_cpu(xen_vcpu, cpu) == &per_cpu(xen_vcpu_info, cpu))
|
|
|
return;
|
|
|
}
|
|
|
- if (cpu < MAX_VIRT_CPUS)
|
|
|
- per_cpu(xen_vcpu,cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
|
|
|
+ if (xen_vcpu_nr(cpu) < MAX_VIRT_CPUS)
|
|
|
+ per_cpu(xen_vcpu, cpu) =
|
|
|
+ &HYPERVISOR_shared_info->vcpu_info[xen_vcpu_nr(cpu)];
|
|
|
|
|
|
if (!have_vcpu_info_placement) {
|
|
|
if (cpu >= MAX_VIRT_CPUS)
|
|
@@ -1783,9 +1784,10 @@ void __ref xen_hvm_init_shared_info(void)
|
|
|
* in that case multiple vcpus might be online. */
|
|
|
for_each_online_cpu(cpu) {
|
|
|
/* Leave it to be NULL. */
|
|
|
- if (cpu >= MAX_VIRT_CPUS)
|
|
|
+ if (xen_vcpu_nr(cpu) >= MAX_VIRT_CPUS)
|
|
|
continue;
|
|
|
- per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
|
|
|
+ per_cpu(xen_vcpu, cpu) =
|
|
|
+ &HYPERVISOR_shared_info->vcpu_info[xen_vcpu_nr(cpu)];
|
|
|
}
|
|
|
}
|
|
|
|