aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2009-05-27 15:56:54 -0400
committerH. Peter Anvin <hpa@zytor.com>2009-06-03 17:44:05 -0400
commitccc3c3192ae78dd56dcdf5353fd1a9ef5f9a3e2b (patch)
tree65f380bd68bdd496f42ac8de88ccb74e340cc968 /arch/x86/include
parentbd19a5e6b73df276e1ccedf9059e9ee70c372d7d (diff)
x86, mce: implement bootstrapping for machine check wakeups
Machine checks support waking up the mcelog daemon quickly. The original wake up code for this was pretty ugly, relying on a idle notifier and a special process flag. The reason it did it this way is that the machine check handler is not subject to normal interrupt locking rules so it's not safe to call wake_up(). Instead it set a process flag and then either did the wakeup in the syscall return or in the idle notifier. This patch adds a new "bootstraping" method as replacement. The idea is that the handler checks if it's in a state where it is unsafe to call wake_up(). If it's safe it calls it directly. When it's not safe -- that is it interrupted in a critical section with interrupts disables -- it uses a new "self IPI" to trigger an IPI to its own CPU. This can be done safely because IPI triggers are atomic with some care. The IPI is raised once the interrupts are reenabled and can then safely call wake_up(). When APICs are disabled the event is just queued and will be picked up eventually by the next polling timer. I think that's a reasonable compromise, since it should only happen quite rarely. Contains fixes from Ying Huang. [ solve conflict on irqinit, make it work on 32bit (entry_arch.h) - HS ] Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/entry_arch.h4
-rw-r--r--arch/x86/include/asm/hw_irq.h1
-rw-r--r--arch/x86/include/asm/irq_vectors.h5
3 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h
index b2eb9c066843..4cdcf5a3c96b 100644
--- a/arch/x86/include/asm/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -60,4 +60,8 @@ BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR)
60BUILD_INTERRUPT(threshold_interrupt,THRESHOLD_APIC_VECTOR) 60BUILD_INTERRUPT(threshold_interrupt,THRESHOLD_APIC_VECTOR)
61#endif 61#endif
62 62
63#ifdef CONFIG_X86_NEW_MCE
64BUILD_INTERRUPT(mce_self_interrupt,MCE_SELF_VECTOR)
65#endif
66
63#endif 67#endif
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index a7d14bbae110..4e59197e29ba 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -32,6 +32,7 @@ extern void error_interrupt(void);
32extern void spurious_interrupt(void); 32extern void spurious_interrupt(void);
33extern void thermal_interrupt(void); 33extern void thermal_interrupt(void);
34extern void reschedule_interrupt(void); 34extern void reschedule_interrupt(void);
35extern void mce_self_interrupt(void);
35 36
36extern void invalidate_interrupt(void); 37extern void invalidate_interrupt(void);
37extern void invalidate_interrupt0(void); 38extern void invalidate_interrupt0(void);
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h
index 8c46b851296a..68f7cf84a333 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -118,6 +118,11 @@
118#define GENERIC_INTERRUPT_VECTOR 0xed 118#define GENERIC_INTERRUPT_VECTOR 0xed
119 119
120/* 120/*
121 * Self IPI vector for machine checks
122 */
123#define MCE_SELF_VECTOR 0xeb
124
125/*
121 * First APIC vector available to drivers: (vectors 0x30-0xee) we 126 * First APIC vector available to drivers: (vectors 0x30-0xee) we
122 * start at 0x31(0x41) to spread out vectors evenly between priority 127 * start at 0x31(0x41) to spread out vectors evenly between priority
123 * levels. (0x80 is the syscall vector) 128 * levels. (0x80 is the syscall vector)