* [patch 2.6.17] Standardize i386/x86_64 handling of NMI_VECTOR
@ 2006-06-22 9:01 Keith Owens
2006-06-22 10:48 ` Andi Kleen
0 siblings, 1 reply; 5+ messages in thread
From: Keith Owens @ 2006-06-22 9:01 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-arch
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.
Signed-off-by: Keith Owens <kaos@sgi.com>
---
arch/i386/kernel/crash.c | 7 +------
arch/i386/kernel/smp.c | 12 +++++++++++-
arch/x86_64/kernel/crash.c | 2 +-
include/asm-i386/hw_irq.h | 2 ++
4 files changed, 15 insertions(+), 8 deletions(-)
Index: linux/arch/i386/kernel/crash.c
===================================================================
--- linux.orig/arch/i386/kernel/crash.c
+++ linux/arch/i386/kernel/crash.c
@@ -119,14 +119,9 @@ static int crash_nmi_callback(struct pt_
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: linux/arch/i386/kernel/smp.c
===================================================================
--- linux.orig/arch/i386/kernel/smp.c
+++ linux/arch/i386/kernel/smp.c
@@ -114,7 +114,17 @@ DEFINE_PER_CPU(struct tlb_state, cpu_tlb
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: linux/arch/x86_64/kernel/crash.c
===================================================================
--- linux.orig/arch/x86_64/kernel/crash.c
+++ linux/arch/x86_64/kernel/crash.c
@@ -118,7 +118,7 @@ static int crash_nmi_callback(struct pt_
static void smp_send_nmi_allbutself(void)
{
- send_IPI_allbutself(APIC_DM_NMI);
+ send_IPI_allbutself(NMI_VECTOR);
}
/*
Index: linux/include/asm-i386/hw_irq.h
===================================================================
--- linux.orig/include/asm-i386/hw_irq.h
+++ linux/include/asm-i386/hw_irq.h
@@ -20,6 +20,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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [patch 2.6.17] Standardize i386/x86_64 handling of NMI_VECTOR
2006-06-22 9:01 [patch 2.6.17] Standardize i386/x86_64 handling of NMI_VECTOR Keith Owens
@ 2006-06-22 10:48 ` Andi Kleen
2006-06-22 11:46 ` Keith Owens
0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2006-06-22 10:48 UTC (permalink / raw)
To: Keith Owens; +Cc: linux-arch
On Thursday 22 June 2006 11:01, Keith Owens wrote:
> 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.
Does that fix anything?
-Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch 2.6.17] Standardize i386/x86_64 handling of NMI_VECTOR
2006-06-22 10:48 ` Andi Kleen
@ 2006-06-22 11:46 ` Keith Owens
2006-06-22 11:59 ` Andi Kleen
0 siblings, 1 reply; 5+ messages in thread
From: Keith Owens @ 2006-06-22 11:46 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-arch
Andi Kleen (on Thu, 22 Jun 2006 12:48:21 +0200) wrote:
>On Thursday 22 June 2006 11:01, Keith Owens wrote:
>> 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.
>
>Does that fix anything?
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch 2.6.17] Standardize i386/x86_64 handling of NMI_VECTOR
2006-06-22 11:46 ` Keith Owens
@ 2006-06-22 11:59 ` Andi Kleen
2006-06-22 12:09 ` Keith Owens
0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2006-06-22 11:59 UTC (permalink / raw)
To: Keith Owens; +Cc: linux-arch
On Thursday 22 June 2006 13:46, Keith Owens wrote:
> Andi Kleen (on Thu, 22 Jun 2006 12:48:21 +0200) wrote:
> >On Thursday 22 June 2006 11:01, Keith Owens wrote:
> >> 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.
> >
> >Does that fix anything?
>
> 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().
I merged it with the updated description. Thanks.
-Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch 2.6.17] Standardize i386/x86_64 handling of NMI_VECTOR
2006-06-22 11:59 ` Andi Kleen
@ 2006-06-22 12:09 ` Keith Owens
0 siblings, 0 replies; 5+ messages in thread
From: Keith Owens @ 2006-06-22 12:09 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-arch
Andi Kleen (on Thu, 22 Jun 2006 13:59:46 +0200) wrote:
>On Thursday 22 June 2006 13:46, Keith Owens wrote:
>> Andi Kleen (on Thu, 22 Jun 2006 12:48:21 +0200) wrote:
>> >On Thursday 22 June 2006 11:01, Keith Owens wrote:
>> >> 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.
>> >
>> >Does that fix anything?
>>
>> 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().
>
>I merged it with the updated description. Thanks.
Merged how much and into which tree? Most of the change is i386, with
a one line change to x86_64. I have to ensure that the i386 bits get
into the main tree.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-06-22 12:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-22 9:01 [patch 2.6.17] Standardize i386/x86_64 handling of NMI_VECTOR Keith Owens
2006-06-22 10:48 ` Andi Kleen
2006-06-22 11:46 ` Keith Owens
2006-06-22 11:59 ` Andi Kleen
2006-06-22 12:09 ` Keith Owens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox