summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/2.6.22/20068_xen-x86-panic-smp.patch1')
-rw-r--r--trunk/2.6.22/20068_xen-x86-panic-smp.patch196
1 files changed, 96 insertions, 0 deletions
diff --git a/trunk/2.6.22/20068_xen-x86-panic-smp.patch1 b/trunk/2.6.22/20068_xen-x86-panic-smp.patch1
new file mode 100644
index 0000000..c94f625
--- /dev/null
+++ b/trunk/2.6.22/20068_xen-x86-panic-smp.patch1
@@ -0,0 +1,96 @@
+From: jbeulich@novell.com
+Subject: panic/shutdown handling adjustments
+Patch-mainline: obsolete
+
+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.)
+
+---
+ 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 | 2 ++
+ 4 files changed, 16 insertions(+), 12 deletions(-)
+
+--- a/arch/i386/kernel/smp-xen.c 2007-08-27 14:01:27.000000000 -0400
++++ b/arch/i386/kernel/smp-xen.c 2007-08-27 14:01:27.000000000 -0400
+@@ -594,9 +594,7 @@ static void stop_this_cpu (void * dummy)
+ * Remove this CPU:
+ */
+ cpu_clear(smp_processor_id(), cpu_online_map);
+-#if 0
+- disable_local_APIC();
+-#endif
++ mask_evtchn_local();
+ if (cpu_data[smp_processor_id()].hlt_works_ok)
+ for(;;) halt();
+ for (;;);
+@@ -616,9 +614,7 @@ void xen_smp_send_stop(void)
+ __smp_call_function(stop_this_cpu, NULL, 0, 0);
+ if (!nolock)
+ spin_unlock(&call_lock);
+-#if 0
+- disable_local_APIC();
+-#endif
++ mask_evtchn_local();
+ local_irq_restore(flags);
+ }
+
+--- a/arch/x86_64/kernel/smp-xen.c 2007-08-27 14:01:27.000000000 -0400
++++ b/arch/x86_64/kernel/smp-xen.c 2007-08-27 14:01:27.000000000 -0400
+@@ -484,9 +484,7 @@ static void stop_this_cpu(void *dummy)
+ * Remove this CPU:
+ */
+ cpu_clear(smp_processor_id(), cpu_online_map);
+-#ifndef CONFIG_XEN
+- disable_local_APIC();
+-#endif
++ mask_evtchn_local();
+ for (;;)
+ halt();
+ }
+@@ -507,9 +505,7 @@ void smp_send_stop(void)
+ __smp_call_function(stop_this_cpu, NULL, 0, 0);
+ if (!nolock)
+ spin_unlock(&call_lock);
+-#ifndef CONFIG_XEN
+- disable_local_APIC();
+-#endif
++ mask_evtchn_local();
+ local_irq_restore(flags);
+ }
+
+--- a/drivers/xen/core/evtchn.c 2007-08-27 14:01:27.000000000 -0400
++++ b/drivers/xen/core/evtchn.c 2007-08-27 14:01:27.000000000 -0400
+@@ -154,6 +154,16 @@ static inline unsigned int cpu_from_evtc
+ return cpu_evtchn[evtchn];
+ }
+
++void mask_evtchn_local(void)
++{
++ unsigned i, cpu = smp_processor_id();
++ shared_info_t *s = HYPERVISOR_shared_info;
++
++ for (i = 0; i < NR_EVENT_CHANNELS; ++i)
++ if (cpu_evtchn[i] == cpu)
++ synch_set_bit(i, &s->evtchn_mask[0]);
++}
++
+ #else
+
+ static inline unsigned long active_evtchns(unsigned int cpu, shared_info_t *sh,
+--- a/include/xen/evtchn.h 2007-08-27 14:01:25.000000000 -0400
++++ b/include/xen/evtchn.h 2007-08-27 14:01:27.000000000 -0400
+@@ -104,6 +104,8 @@ void evtchn_device_upcall(int port);
+ void mask_evtchn(int port);
+ void unmask_evtchn(int port);
+
++extern void mask_evtchn_local(void);
++
+ static inline void clear_evtchn(int port)
+ {
+ shared_info_t *s = HYPERVISOR_shared_info;