WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 05/11] xen/hvm kexec: unregister debugirq during rebo

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 05/11] xen/hvm kexec: unregister debugirq during reboot
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Thu, 28 Jul 2011 15:23:05 +0200
Delivery-date: Thu, 28 Jul 2011 06:26:47 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1311859384; l=1613; s=domk; d=aepfle.de; h=References:Subject:To:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=gPimNmV2l/1ql+jBqicNwb8ZT+w=; b=clLo2uSfPIRMFK5hoSe5gh3R1bvXCMf5PaGF+P48OpJX/ObIO5fsLqk9PgikgVDCCVT yIV3+KNRW3xbow7ovqi0gAeQjT7h7ePiAiMLBL6gAU/e0uKK54BMHN6hTp9lspFn2xOVZ NuJ3MzZh8tlfCxtKG9A4yT9MnF2h62U0B38=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20110728132300.248098023@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.48-16.4
Unregister the debugirq during kexec, otherwise the kexec kernel will
run into the BUG() in bind_virq_to_irq() when trying to bind to the
still registered virq.

v2:
 use kexec_is_loaded() function

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

---
 arch/x86/xen/smp.c |   22 ++++++++++++++++++++++
 1 file changed, 22 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,8 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/smp.h>
+#include <linux/kexec.h>
+#include <linux/syscore_ops.h>
 
 #include <asm/paravirt.h>
 #include <asm/desc.h>
@@ -45,6 +47,25 @@ 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;
+
+       if (!kexec_is_loaded())
+               return;
+
+       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 +546,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)


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel