aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Owens <kaos@sgi.com>2006-06-26 07:59:56 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 13:48:22 -0400
commite77deacb7b078156fcadf27b838a4ce1a65eda04 (patch)
treee594ce9a9f65c45e19cfb3b8417c614dd2eb5386
parent704fc59e1d056de80beaf30174bc8e0b1682efbb (diff)
[PATCH] x86_64: Avoid broadcasting NMI IPIs
On some i386/x86_64 systems, sending an NMI IPI as a broadcast will reset the system. This seems to be a BIOS bug which affects machines where one or more cpus are not under OS control. It occurs on HT systems with a version of the OS that is not compiled without HT support. It also occurs when a system is booted with max_cpus=n where 2 <= n < cpus known to the BIOS. The fix is to always send NMI IPI as a mask instead of as a broadcast. Signed-off-by: Keith Owens <kaos@sgi.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/x86_64/kernel/genapic_flat.c25
-rw-r--r--include/asm-i386/mach-default/mach_ipi.h7
2 files changed, 21 insertions, 11 deletions
diff --git a/arch/x86_64/kernel/genapic_flat.c b/arch/x86_64/kernel/genapic_flat.c
index c66ca7b1d31a..21c7066e236a 100644
--- a/arch/x86_64/kernel/genapic_flat.c
+++ b/arch/x86_64/kernel/genapic_flat.c
@@ -78,22 +78,29 @@ static void flat_send_IPI_mask(cpumask_t cpumask, int vector)
78 78
79static void flat_send_IPI_allbutself(int vector) 79static void flat_send_IPI_allbutself(int vector)
80{ 80{
81#ifndef CONFIG_HOTPLUG_CPU 81#ifdef CONFIG_HOTPLUG_CPU
82 if (((num_online_cpus()) - 1) >= 1) 82 int hotplug = 1;
83 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL);
84#else 83#else
85 cpumask_t allbutme = cpu_online_map; 84 int hotplug = 0;
85#endif
86 if (hotplug || vector == NMI_VECTOR) {
87 cpumask_t allbutme = cpu_online_map;
86 88
87 cpu_clear(smp_processor_id(), allbutme); 89 cpu_clear(smp_processor_id(), allbutme);
88 90
89 if (!cpus_empty(allbutme)) 91 if (!cpus_empty(allbutme))
90 flat_send_IPI_mask(allbutme, vector); 92 flat_send_IPI_mask(allbutme, vector);
91#endif 93 } else if (num_online_cpus() > 1) {
94 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL);
95 }
92} 96}
93 97
94static void flat_send_IPI_all(int vector) 98static void flat_send_IPI_all(int vector)
95{ 99{
96 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL); 100 if (vector == NMI_VECTOR)
101 flat_send_IPI_mask(cpu_online_map, vector);
102 else
103 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
97} 104}
98 105
99static int flat_apic_id_registered(void) 106static int flat_apic_id_registered(void)
diff --git a/include/asm-i386/mach-default/mach_ipi.h b/include/asm-i386/mach-default/mach_ipi.h
index a1d0072e36bc..0dba244c86db 100644
--- a/include/asm-i386/mach-default/mach_ipi.h
+++ b/include/asm-i386/mach-default/mach_ipi.h
@@ -1,6 +1,9 @@
1#ifndef __ASM_MACH_IPI_H 1#ifndef __ASM_MACH_IPI_H
2#define __ASM_MACH_IPI_H 2#define __ASM_MACH_IPI_H
3 3
4/* Avoid include hell */
5#define NMI_VECTOR 0x02
6
4void send_IPI_mask_bitmask(cpumask_t mask, int vector); 7void send_IPI_mask_bitmask(cpumask_t mask, int vector);
5void __send_IPI_shortcut(unsigned int shortcut, int vector); 8void __send_IPI_shortcut(unsigned int shortcut, int vector);
6 9
@@ -13,7 +16,7 @@ static inline void send_IPI_mask(cpumask_t mask, int vector)
13 16
14static inline void __local_send_IPI_allbutself(int vector) 17static inline void __local_send_IPI_allbutself(int vector)
15{ 18{
16 if (no_broadcast) { 19 if (no_broadcast || vector == NMI_VECTOR) {
17 cpumask_t mask = cpu_online_map; 20 cpumask_t mask = cpu_online_map;
18 21
19 cpu_clear(smp_processor_id(), mask); 22 cpu_clear(smp_processor_id(), mask);
@@ -24,7 +27,7 @@ static inline void __local_send_IPI_allbutself(int vector)
24 27
25static inline void __local_send_IPI_all(int vector) 28static inline void __local_send_IPI_all(int vector)
26{ 29{
27 if (no_broadcast) 30 if (no_broadcast || vector == NMI_VECTOR)
28 send_IPI_mask(cpu_online_map, vector); 31 send_IPI_mask(cpu_online_map, vector);
29 else 32 else
30 __send_IPI_shortcut(APIC_DEST_ALLINC, vector); 33 __send_IPI_shortcut(APIC_DEST_ALLINC, vector);