Skip to contentSkip to conversation

Fix vcpu restore path.

PATCH In review Wei Liu 2 participants 2 messages Dec 13, 2012

Subsystems (2)
lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 Fix vcpu restore path.

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

---
 arch/x86/xen/enlighten.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
arch/x86/xen/enlighten.c +4 -3
index ff962d4..bc893e7 100644
@@ -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();
 	}
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines
Quoted 1 line
Quoted 1 line · Wei Liu

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

Quoted 39 lines
---
 arch/x86/xen/enlighten.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
arch/x86/xen/enlighten.c +4 -3
index ff962d4..bc893e7 100644
@@ -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();
 	}
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected] 
http://lists.xen.org/xen-devel