Commit 9d328a94 authored by Wei Liu's avatar Wei Liu Committed by Konrad Rzeszutek Wilk

xen/vcpu: Fix vcpu restore path.

The runstate of vcpu should be restored for all possible cpus, as well as the
vcpu info placement.
Acked-by: default avatarJan Beulich <jbeulich@suse.com>
Signed-off-by: default avatarWei Liu <wei.liu2@citrix.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent cc31fd9c
...@@ -193,10 +193,11 @@ void xen_vcpu_restore(void) ...@@ -193,10 +193,11 @@ void xen_vcpu_restore(void)
{ {
int cpu; int cpu;
for_each_online_cpu(cpu) { for_each_possible_cpu(cpu) {
bool other_cpu = (cpu != smp_processor_id()); bool other_cpu = (cpu != smp_processor_id());
bool is_up = HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL);
if (other_cpu && if (other_cpu && is_up &&
HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL)) HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL))
BUG(); BUG();
...@@ -205,7 +206,7 @@ void xen_vcpu_restore(void) ...@@ -205,7 +206,7 @@ void xen_vcpu_restore(void)
if (have_vcpu_info_placement) if (have_vcpu_info_placement)
xen_vcpu_setup(cpu); xen_vcpu_setup(cpu);
if (other_cpu && if (other_cpu && is_up &&
HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL)) HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL))
BUG(); BUG();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment