xen/vcpu: Fix vcpu restore path.
authorWei Liu <wei.liu2@citrix.com>
Thu, 13 Dec 2012 15:33:05 +0000 (15:33 +0000)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 18 Dec 2012 02:58:09 +0000 (21:58 -0500)
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>
arch/x86/xen/enlighten.c

index 3aeaa933b5278cc48944aaa4eeb9fdfaffcade50..138e5667409a3415492e860c8cfa708028d6d467 100644 (file)
@@ -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();
 
@@ -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();
        }