xen/smp: Unifiy some of the PVs and PVHVM offline CPU path
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 9 Apr 2013 00:56:35 +0000 (20:56 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 16 Apr 2013 20:05:17 +0000 (16:05 -0400)
The "xen_cpu_die" and "xen_hvm_cpu_die" are very similar.
Lets coalesce them.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/x86/xen/smp.c

index 415694c..0d466d7 100644 (file)
@@ -428,7 +428,7 @@ static int xen_cpu_disable(void)
 
 static void xen_cpu_die(unsigned int cpu)
 {
-       while (HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL)) {
+       while (xen_pv_domain() && HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL)) {
                current->state = TASK_UNINTERRUPTIBLE;
                schedule_timeout(HZ/10);
        }
@@ -436,7 +436,8 @@ static void xen_cpu_die(unsigned int cpu)
        unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu), NULL);
        unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu), NULL);
        unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu), NULL);
-       unbind_from_irqhandler(per_cpu(xen_irq_work, cpu), NULL);
+       if (!xen_hvm_domain())
+               unbind_from_irqhandler(per_cpu(xen_irq_work, cpu), NULL);
        xen_uninit_lock_cpu(cpu);
        xen_teardown_timer(cpu);
 }
@@ -667,14 +668,7 @@ static int __cpuinit xen_hvm_cpu_up(unsigned int cpu, struct task_struct *tidle)
 
 static void xen_hvm_cpu_die(unsigned int cpu)
 {
-       unbind_from_irqhandler(per_cpu(xen_resched_irq, cpu), NULL);
-       unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu), NULL);
-       unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu), NULL);
-       unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu), NULL);
-       if (!xen_hvm_domain())
-               unbind_from_irqhandler(per_cpu(xen_irq_work, cpu), NULL);
-       xen_uninit_lock_cpu(cpu);
-       xen_teardown_timer(cpu);
+       xen_cpu_die(cpu);
        native_cpu_die(cpu);
 }