From: Olaf Hering Subject: [PATCH 4/6] xen/hvm kexec: unbind debugirq during reboot Date: Tue, 26 Jul 2011 13:52:13 +0200 Message-ID: <20110726115210.924427683@aepfle.de> References: <20110726115209.655568638@aepfle.de> Return-path: Content-Disposition: inline; filename=xen.syscore_ops.smp.unbind-xen_debug_irq.patch List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Unregister the debugirq during kexec, otherwise the kexec kernel can not bind to the still registered virq. Signed-off-by: Olaf Hering --- arch/x86/xen/smp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) Index: linux-3.0/arch/x86/xen/smp.c =================================================================== --- linux-3.0.orig/arch/x86/xen/smp.c +++ linux-3.0/arch/x86/xen/smp.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -45,6 +46,21 @@ static DEFINE_PER_CPU(int, xen_debug_irq static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id); static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id); +static void xen_hvn_smp_shutdown(void) +{ + int cpu; + for_each_online_cpu(cpu) { + if (per_cpu(xen_debug_irq, cpu) < 0) + continue; + unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu), NULL); + per_cpu(xen_debug_irq, cpu) = -1; + } +} + +static struct syscore_ops xen_hvn_smp_syscore_ops = { + .shutdown = xen_hvn_smp_shutdown, +}; + /* * Reschedule call back. */ @@ -525,6 +541,7 @@ static void __init xen_hvm_smp_prepare_c return; xen_init_lock_cpu(0); xen_init_spinlocks(); + register_syscore_ops(&xen_hvn_smp_syscore_ops); } static int __cpuinit xen_hvm_cpu_up(unsigned int cpu)