Commit e77deacb authored by Keith Owens's avatar Keith Owens Committed by Linus Torvalds

[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: default avatarKeith Owens <kaos@sgi.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 704fc59e
...@@ -78,21 +78,28 @@ static void flat_send_IPI_mask(cpumask_t cpumask, int vector) ...@@ -78,21 +78,28 @@ static void flat_send_IPI_mask(cpumask_t cpumask, int vector)
static void flat_send_IPI_allbutself(int vector) static void flat_send_IPI_allbutself(int vector)
{ {
#ifndef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
if (((num_online_cpus()) - 1) >= 1) int hotplug = 1;
__send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL);
#else #else
int hotplug = 0;
#endif
if (hotplug || vector == NMI_VECTOR) {
cpumask_t allbutme = cpu_online_map; cpumask_t allbutme = cpu_online_map;
cpu_clear(smp_processor_id(), allbutme); cpu_clear(smp_processor_id(), allbutme);
if (!cpus_empty(allbutme)) if (!cpus_empty(allbutme))
flat_send_IPI_mask(allbutme, vector); flat_send_IPI_mask(allbutme, vector);
#endif } else if (num_online_cpus() > 1) {
__send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL);
}
} }
static void flat_send_IPI_all(int vector) static void flat_send_IPI_all(int vector)
{ {
if (vector == NMI_VECTOR)
flat_send_IPI_mask(cpu_online_map, vector);
else
__send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL); __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
} }
......
#ifndef __ASM_MACH_IPI_H #ifndef __ASM_MACH_IPI_H
#define __ASM_MACH_IPI_H #define __ASM_MACH_IPI_H
/* Avoid include hell */
#define NMI_VECTOR 0x02
void send_IPI_mask_bitmask(cpumask_t mask, int vector); void send_IPI_mask_bitmask(cpumask_t mask, int vector);
void __send_IPI_shortcut(unsigned int shortcut, int vector); void __send_IPI_shortcut(unsigned int shortcut, int vector);
...@@ -13,7 +16,7 @@ static inline void send_IPI_mask(cpumask_t mask, int vector) ...@@ -13,7 +16,7 @@ static inline void send_IPI_mask(cpumask_t mask, int vector)
static inline void __local_send_IPI_allbutself(int vector) static inline void __local_send_IPI_allbutself(int vector)
{ {
if (no_broadcast) { if (no_broadcast || vector == NMI_VECTOR) {
cpumask_t mask = cpu_online_map; cpumask_t mask = cpu_online_map;
cpu_clear(smp_processor_id(), mask); cpu_clear(smp_processor_id(), mask);
...@@ -24,7 +27,7 @@ static inline void __local_send_IPI_allbutself(int vector) ...@@ -24,7 +27,7 @@ static inline void __local_send_IPI_allbutself(int vector)
static inline void __local_send_IPI_all(int vector) static inline void __local_send_IPI_all(int vector)
{ {
if (no_broadcast) if (no_broadcast || vector == NMI_VECTOR)
send_IPI_mask(cpu_online_map, vector); send_IPI_mask(cpu_online_map, vector);
else else
__send_IPI_shortcut(APIC_DEST_ALLINC, vector); __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment