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 5/6] xen/hvm kexec: unregister timer interrupt during

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 5/6] xen/hvm kexec: unregister timer interrupt during reboot
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Tue, 26 Jul 2011 13:52:14 +0200
Delivery-date: Tue, 26 Jul 2011 04:56:33 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1311681171; l=1937; s=domk; d=aepfle.de; h=References:Subject:To:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=rNM/t1Td+eP0xTa50VDvFj4tSFs=; b=cwf4PSkgSjUf6jefH0SGzlb5/ycaaS7/shwS3utQHaMwvI1B+HADNIuun40AwPP/NeE GJ1mQ7eFX3fzMAWdRYjG558nVKbGarBOIJEMttjemHFs4lkv1xav26T7UVVrMxvGERxcP KqbwfPQXEVc9k7/J0FbJaFYDN4yFiQQAKoI=
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: <20110726115209.655568638@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.48-16.4
The kexec kernel will crash because the timer interrupt is already
registerd with EVTCHNOP_bind_virq.  Unbind the event channel during
shutdown so that the kexec kernel can reregister the interrupt.

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

---
 arch/x86/xen/time.c |   27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

Index: linux-3.0/arch/x86/xen/time.c
===================================================================
--- linux-3.0.orig/arch/x86/xen/time.c
+++ linux-3.0/arch/x86/xen/time.c
@@ -14,6 +14,7 @@
 #include <linux/kernel_stat.h>
 #include <linux/math64.h>
 #include <linux/gfp.h>
+#include <linux/syscore_ops.h>
 
 #include <asm/pvclock.h>
 #include <asm/xen/hypervisor.h>
@@ -405,12 +406,20 @@ void xen_setup_timer(int cpu)
        evt->irq = irq;
 }
 
-void xen_teardown_timer(int cpu)
+static void xen_unbind_timer(int cpu)
 {
        struct clock_event_device *evt;
-       BUG_ON(cpu == 0);
        evt = &per_cpu(xen_clock_events, cpu);
-       unbind_from_irqhandler(evt->irq, NULL);
+       if (evt->irq >= 0) {
+               unbind_from_irqhandler(evt->irq, NULL);
+               evt->irq = -1;
+       }
+}
+
+void xen_teardown_timer(int cpu)
+{
+       BUG_ON(cpu == 0);
+       xen_unbind_timer(cpu);
 }
 
 void xen_setup_cpu_clockevents(void)
@@ -478,6 +487,17 @@ void __init xen_init_time_ops(void)
 }
 
 #ifdef CONFIG_XEN_PVHVM
+static void xen_hvmtimer_shutdown(void)
+{
+       int cpu;
+       for_each_online_cpu(cpu)
+               xen_unbind_timer(cpu);
+}
+
+static struct syscore_ops xen_hvmtimer_syscore_ops = {
+       .shutdown = xen_hvmtimer_shutdown,
+};
+
 static void xen_hvm_setup_cpu_clockevents(void)
 {
        int cpu = smp_processor_id();
@@ -506,5 +526,6 @@ void __init xen_hvm_init_time_ops(void)
        x86_platform.calibrate_tsc = xen_tsc_khz;
        x86_platform.get_wallclock = xen_get_wallclock;
        x86_platform.set_wallclock = xen_set_wallclock;
+       register_syscore_ops(&xen_hvmtimer_syscore_ops);
 }
 #endif


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

<Prev in Thread] Current Thread [Next in Thread>