Skip to content

Commit

Permalink
xen/vcpu: Fix vcpu restore path.
Browse files Browse the repository at this point in the history
The runstate of vcpu should be restored for all possible cpus, as well as the
vcpu info placement.

Acked-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Wei Liu authored and Konrad Rzeszutek Wilk committed Dec 18, 2012
1 parent cc31fd9 commit 9d328a9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,11 @@ void xen_vcpu_restore(void)
{
int cpu;

for_each_online_cpu(cpu) {
for_each_possible_cpu(cpu) {
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))
BUG();

Expand All @@ -205,7 +206,7 @@ void xen_vcpu_restore(void)
if (have_vcpu_info_placement)
xen_vcpu_setup(cpu);

if (other_cpu &&
if (other_cpu && is_up &&
HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL))
BUG();
}
Expand Down

0 comments on commit 9d328a9

Please sign in to comment.