|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 04/11] xen/hvm kexec: unregister timer interrupt duri
Unregister the timer interrupt 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/time.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 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,8 @@
#include <linux/kernel_stat.h>
#include <linux/math64.h>
#include <linux/gfp.h>
+#include <linux/kexec.h>
+#include <linux/syscore_ops.h>
#include <asm/pvclock.h>
#include <asm/xen/hypervisor.h>
@@ -405,11 +407,19 @@ 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;
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)
+{
+ xen_unbind_timer(cpu);
}
void xen_setup_cpu_clockevents(void)
@@ -477,6 +487,21 @@ void __init xen_init_time_ops(void)
}
#ifdef CONFIG_XEN_PVHVM
+static void xen_hvm_timer_shutdown(void)
+{
+ int cpu;
+
+ if (!kexec_is_loaded())
+ return;
+
+ for_each_online_cpu(cpu)
+ xen_unbind_timer(cpu);
+}
+
+static struct syscore_ops xen_hvmtimer_syscore_ops = {
+ .shutdown = xen_hvm_timer_shutdown,
+};
+
static void xen_hvm_setup_cpu_clockevents(void)
{
int cpu = smp_processor_id();
@@ -505,5 +530,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>
|
- [Xen-devel] [PATCH 00/11] [v2] misc changes for kexec in pv-on-hvm guests, Olaf Hering
- [Xen-devel] [PATCH 03/11] xen: use static initializers in xen-balloon.c, Olaf Hering
- [Xen-devel] [PATCH 06/11] xen/hvm kexec: unregister shutdown+sysrq watches during reboot, Olaf Hering
- [Xen-devel] [PATCH 05/11] xen/hvm kexec: unregister debugirq during reboot, Olaf Hering
- [Xen-devel] [PATCH 04/11] xen/hvm kexec: unregister timer interrupt during reboot,
Olaf Hering <=
- [Xen-devel] [PATCH 02/11] xen: remove BUG_ON from xen_teardown_timer, Olaf Hering
- [Xen-devel] [PATCH 08/11] xen/hvm kexec: unregister the watch of the "backend" node during reboot, Olaf Hering
- [Xen-devel] [PATCH 07/11] xen/hvm kexec: unregister memory/target watch in xen-balloon.c, Olaf Hering
- [Xen-devel] [PATCH 01/11] kexec: add kexec_is_loaded function, Olaf Hering
- [Xen-devel] [PATCH 10/11] xen kexec: reset device state to Initializing during reboot, Olaf Hering
- [Xen-devel] [PATCH 11/11] xen/hvm kdump: reset PV devices in crash kernel, Olaf Hering
- [Xen-devel] [PATCH 09/11] xen/hvm kexec: unregister the watch of the "device" node during reboot, Olaf Hering
|
|
|
|
|