[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Fix vcpu restore path.



The runstate of vcpu should be restored for all possible cpus, as well as the
vcpu info placement.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 arch/x86/xen/enlighten.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index ff962d4..bc893e7 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -178,10 +178,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();
 
@@ -190,7 +191,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();
        }
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.