]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
linux: panic/shutdown handling adjustments
authorKeir Fraser <keir@xensource.com>
Thu, 25 Oct 2007 15:15:18 +0000 (16:15 +0100)
committerKeir Fraser <keir@xensource.com>
Thu, 25 Oct 2007 15:15:18 +0000 (16:15 +0100)
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@novell.com>
arch/i386/kernel/smp-xen.c
arch/x86_64/kernel/smp-xen.c
drivers/xen/core/evtchn.c
include/xen/evtchn.h

index a56f38314b2a6cf918bd09cc58a40f1b1057e7bf..402819df0cfe5c014afddd98e42920cf0b29bed2 100644 (file)
@@ -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();
 }
 
index 32761b5f8a701af19fc80b7688b1951d8fdfe75f..727c255a95157b21f9c1d130b3a0a12a85f173eb 100644 (file)
@@ -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();
 }
 
index 8cde6d4fe38f6eb06cbd0ce63c88b6c9730b6acb..6e83ca2d219b5648c78a3d6a136c94d56c271026 100644 (file)
@@ -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;
index 7781be2fc84bee4523409420005ab2952409576e..4b18ddfe2990bb870f769089bd3b76e511b44807 100644 (file)
@@ -102,6 +102,7 @@ asmlinkage void evtchn_do_upcall(struct pt_regs *regs);
 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