]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
[PATCH] x86_64: Standardize i386/x86_64 handling of NMI_VECTOR
authorKeith Owens <kaos@sgi.com>
Mon, 26 Jun 2006 11:59:41 +0000 (13:59 +0200)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 26 Jun 2006 17:48:22 +0000 (10:48 -0700)
x86_64 and i386 behave inconsistently when sending an IPI on vector 2
(NMI_VECTOR).  Make both behave the same, so IPI 2 is sent as NMI.

The crash code was abusing send_IPI_allbutself() by passing a code
instead of a vector, it only worked because crash knew about the
internal code of send_IPI_allbutself().  Change crash to use NMI_VECTOR
instead, and remove the comment about how crash was abusing the function.

This patch is a pre-requisite for fixing the problem where sending an
IPI as NMI would reboot some Dell Xeon systems.  I cannot fix that
problem while crash continus to abuse send_IPI_allbutself().

It also removes the inconsistency between i386 and x86_64 for
NMI_VECTOR.  That will simplify all the RAS code that needs to bring
all the cpus to a clean stop, even when one or more cpus are spinning
disabled.

Signed-off-by: Keith Owens <kaos@sgi.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/crash.c
arch/i386/kernel/smp.c
arch/x86_64/kernel/crash.c
include/asm-i386/hw_irq.h

index 21dc1bbb806722bf26bf5d4348d01d386b72d7ce..0c88d3ec8c18bb6d19cf6db11c38c0d72ac65685 100644 (file)
@@ -120,14 +120,9 @@ static int crash_nmi_callback(struct pt_regs *regs, int cpu)
        return 1;
 }
 
-/*
- * By using the NMI code instead of a vector we just sneak thru the
- * word generator coming out with just what we want.  AND it does
- * not matter if clustered_apic_mode is set or not.
- */
 static void smp_send_nmi_allbutself(void)
 {
-       send_IPI_allbutself(APIC_DM_NMI);
+       send_IPI_allbutself(NMI_VECTOR);
 }
 
 static void nmi_shootdown_cpus(void)
index d134e9643a58a0303cb67672486709d9da244591..c10789d7a9d38673194cf0074fa564a9fd64612c 100644 (file)
@@ -114,7 +114,17 @@ DEFINE_PER_CPU(struct tlb_state, cpu_tlbstate) ____cacheline_aligned = { &init_m
 
 static inline int __prepare_ICR (unsigned int shortcut, int vector)
 {
-       return APIC_DM_FIXED | shortcut | vector | APIC_DEST_LOGICAL;
+       unsigned int icr = shortcut | APIC_DEST_LOGICAL;
+
+       switch (vector) {
+       default:
+               icr |= APIC_DM_FIXED | vector;
+               break;
+       case NMI_VECTOR:
+               icr |= APIC_DM_NMI;
+               break;
+       }
+       return icr;
 }
 
 static inline int __prepare_ICR2 (unsigned int mask)
index ec1c7431d5af91074f2640564a0d4b0e6a624783..8ca04912b1cc6f8e44ec29b3a585d84d00653557 100644 (file)
@@ -118,7 +118,7 @@ static int crash_nmi_callback(struct pt_regs *regs, int cpu)
 
 static void smp_send_nmi_allbutself(void)
 {
-       send_IPI_allbutself(APIC_DM_NMI);
+       send_IPI_allbutself(NMI_VECTOR);
 }
 
 /*
index 95d3fd090298be566194d02812bf07c0dda807c2..a4c0a5a9ffd84cd4a5c18eab814dc89f08cb69f8 100644 (file)
@@ -19,6 +19,8 @@
 
 struct hw_interrupt_type;
 
+#define NMI_VECTOR             0x02
+
 /*
  * Various low-level irq details needed by irq.c, process.c,
  * time.c, io_apic.c and smp.c