# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1193325318 -3600
# Node ID b7a740a85fcb5e31edb49dbe594089d814b28714
# Parent c8002e78cb1b8369427b5350a8334cb3da142469
linux: panic/shutdown handling adjustments
Prevent interrupts (and hence possibly scheduler operations) from
occuring on (against) a CPU after removing it from cpu_online_map
during panic/shutdown.
(Background: I found it quite annoying to see scheduler related
badness or BUG messages after a panic, eventually even leading to
important information scrolling off the screen.)
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
arch/i386/kernel/smp-xen.c | 8 ++------
arch/x86_64/kernel/smp-xen.c | 8 ++------
drivers/xen/core/evtchn.c | 10 ++++++++++
include/xen/evtchn.h | 1 +
4 files changed, 15 insertions(+), 12 deletions(-)
diff -r c8002e78cb1b -r b7a740a85fcb arch/i386/kernel/smp-xen.c
--- a/arch/i386/kernel/smp-xen.c Thu Oct 25 16:10:19 2007 +0100
+++ b/arch/i386/kernel/smp-xen.c Thu Oct 25 16:15:18 2007 +0100
@@ -558,9 +558,7 @@ static void stop_this_cpu (void * dummy)
*/
cpu_clear(smp_processor_id(), cpu_online_map);
local_irq_disable();
-#if 0
- disable_local_APIC();
-#endif
+ disable_all_local_evtchn();
if (cpu_data[smp_processor_id()].hlt_works_ok)
for(;;) halt();
for (;;);
@@ -575,9 +573,7 @@ void smp_send_stop(void)
smp_call_function(stop_this_cpu, NULL, 1, 0);
local_irq_disable();
-#if 0
- disable_local_APIC();
-#endif
+ disable_all_local_evtchn();
local_irq_enable();
}
diff -r c8002e78cb1b -r b7a740a85fcb arch/x86_64/kernel/smp-xen.c
--- a/arch/x86_64/kernel/smp-xen.c Thu Oct 25 16:10:19 2007 +0100
+++ b/arch/x86_64/kernel/smp-xen.c Thu Oct 25 16:15:18 2007 +0100
@@ -482,9 +482,7 @@ void smp_stop_cpu(void)
*/
cpu_clear(smp_processor_id(), cpu_online_map);
local_irq_save(flags);
-#ifndef CONFIG_XEN
- disable_local_APIC();
-#endif
+ disable_all_local_evtchn();
local_irq_restore(flags);
}
@@ -512,9 +510,7 @@ void smp_send_stop(void)
spin_unlock(&call_lock);
local_irq_disable();
-#ifndef CONFIG_XEN
- disable_local_APIC();
-#endif
+ disable_all_local_evtchn();
local_irq_enable();
}
diff -r c8002e78cb1b -r b7a740a85fcb drivers/xen/core/evtchn.c
--- a/drivers/xen/core/evtchn.c Thu Oct 25 16:10:19 2007 +0100
+++ b/drivers/xen/core/evtchn.c Thu Oct 25 16:15:18 2007 +0100
@@ -892,6 +892,16 @@ void unmask_evtchn(int port)
}
EXPORT_SYMBOL_GPL(unmask_evtchn);
+void disable_all_local_evtchn(void)
+{
+ unsigned i, cpu = smp_processor_id();
+ shared_info_t *s = HYPERVISOR_shared_info;
+
+ for (i = 0; i < NR_EVENT_CHANNELS; ++i)
+ if (cpu_from_evtchn(i) == cpu)
+ synch_set_bit(i, &s->evtchn_mask[0]);
+}
+
static void restore_cpu_virqs(int cpu)
{
struct evtchn_bind_virq bind_virq;
diff -r c8002e78cb1b -r b7a740a85fcb include/xen/evtchn.h
--- a/include/xen/evtchn.h Thu Oct 25 16:10:19 2007 +0100
+++ b/include/xen/evtchn.h Thu Oct 25 16:15:18 2007 +0100
@@ -102,6 +102,7 @@ void evtchn_device_upcall(int port);
void evtchn_device_upcall(int port);
void mask_evtchn(int port);
+void disable_all_local_evtchn(void);
void unmask_evtchn(int port);
#ifdef CONFIG_SMP
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|