public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.13] x86_64: Rename KDB_VECTOR to NMI_VECTOR
@ 2005-09-08 16:39 Tom Rini
  2005-09-09  8:06 ` Andi Kleen
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Rini @ 2005-09-08 16:39 UTC (permalink / raw)
  To: Andrew Morton, Kernel Mailing List; +Cc: Andi Kleen, Keith Owens

The existing hook from KDB in the IPI code is really just a hook for the
NMI vector.  We rename the vector thusly and then it's up to the
debugger to handle things from do_default_nmi().

---

 linux-2.6.13-trini/arch/x86_64/kernel/i8259.c  |    3 +--
 linux-2.6.13-trini/arch/x86_64/kernel/smp.c    |    2 +-
 linux-2.6.13-trini/arch/x86_64/kernel/traps.c  |    2 +-
 linux-2.6.13-trini/include/asm-x86_64/hw_irq.h |    2 +-
 linux-2.6.13-trini/include/asm-x86_64/ipi.h    |    2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)

diff -puN arch/x86_64/kernel/i8259.c~x86_64-rename_kdb_vector arch/x86_64/kernel/i8259.c
--- linux-2.6.13/arch/x86_64/kernel/i8259.c~x86_64-rename_kdb_vector	2005-09-01 12:00:42.000000000 -0700
+++ linux-2.6.13-trini/arch/x86_64/kernel/i8259.c	2005-09-01 12:00:42.000000000 -0700
@@ -544,10 +544,9 @@ void __init init_IRQ(void)
 		int vector = FIRST_EXTERNAL_VECTOR + i;
 		if (i >= NR_IRQS)
 			break;
-		if (vector != IA32_SYSCALL_VECTOR && vector != KDB_VECTOR) { 
+		if (vector != IA32_SYSCALL_VECTOR && vector != NMI_VECTOR)
 			set_intr_gate(vector, interrupt[i]);
 	}
-	}
 
 #ifdef CONFIG_SMP
 	/*
diff -puN arch/x86_64/kernel/smp.c~x86_64-rename_kdb_vector arch/x86_64/kernel/smp.c
--- linux-2.6.13/arch/x86_64/kernel/smp.c~x86_64-rename_kdb_vector	2005-09-01 12:00:42.000000000 -0700
+++ linux-2.6.13-trini/arch/x86_64/kernel/smp.c	2005-09-01 12:00:42.000000000 -0700
@@ -252,7 +252,7 @@ void flush_tlb_all(void)
 
 void smp_kdb_stop(void)
 {
-	send_IPI_allbutself(KDB_VECTOR);
+	send_IPI_allbutself(NMI_VECTOR);
 }
 
 /*
diff -puN arch/x86_64/kernel/traps.c~x86_64-rename_kdb_vector arch/x86_64/kernel/traps.c
--- linux-2.6.13/arch/x86_64/kernel/traps.c~x86_64-rename_kdb_vector	2005-09-01 12:00:42.000000000 -0700
+++ linux-2.6.13-trini/arch/x86_64/kernel/traps.c	2005-09-01 12:00:56.000000000 -0700
@@ -931,7 +931,7 @@ void __init trap_init(void)
 	set_system_gate(IA32_SYSCALL_VECTOR, ia32_syscall);
 #endif
        
-	set_intr_gate(KDB_VECTOR, call_debug);
+	set_intr_gate(NMI_VECTOR, call_debug);
        
 	/*
 	 * Should be a barrier for any external CPU state.
diff -puN include/asm-x86_64/hw_irq.h~x86_64-rename_kdb_vector include/asm-x86_64/hw_irq.h
--- linux-2.6.13/include/asm-x86_64/hw_irq.h~x86_64-rename_kdb_vector	2005-09-01 12:00:42.000000000 -0700
+++ linux-2.6.13-trini/include/asm-x86_64/hw_irq.h	2005-09-01 12:00:42.000000000 -0700
@@ -54,7 +54,7 @@ struct hw_interrupt_type;
 #define RESCHEDULE_VECTOR	0xfc
 #define TASK_MIGRATION_VECTOR	0xfb
 #define CALL_FUNCTION_VECTOR	0xfa
-#define KDB_VECTOR	0xf9
+#define NMI_VECTOR	0xf9
 
 #define THERMAL_APIC_VECTOR	0xf0
 
diff -puN include/asm-x86_64/ipi.h~x86_64-rename_kdb_vector include/asm-x86_64/ipi.h
--- linux-2.6.13/include/asm-x86_64/ipi.h~x86_64-rename_kdb_vector	2005-09-01 12:00:42.000000000 -0700
+++ linux-2.6.13-trini/include/asm-x86_64/ipi.h	2005-09-01 12:00:42.000000000 -0700
@@ -32,7 +32,7 @@
 static inline unsigned int __prepare_ICR (unsigned int shortcut, int vector, unsigned int dest)
 {
 	unsigned int icr =  APIC_DM_FIXED | shortcut | vector | dest;
-	if (vector == KDB_VECTOR)
+	if (vector == NMI_VECTOR)
 		icr = (icr & (~APIC_VECTOR_MASK)) | APIC_DM_NMI;
 	return icr;
 }

-- 
Tom Rini
http://gate.crashing.org/~trini/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2.6.13] x86_64: Rename KDB_VECTOR to NMI_VECTOR
  2005-09-08 16:39 [PATCH 2.6.13] x86_64: Rename KDB_VECTOR to NMI_VECTOR Tom Rini
@ 2005-09-09  8:06 ` Andi Kleen
  0 siblings, 0 replies; 2+ messages in thread
From: Andi Kleen @ 2005-09-09  8:06 UTC (permalink / raw)
  To: Tom Rini, jbeulich; +Cc: Andrew Morton, Kernel Mailing List, Keith Owens

On Thursday 08 September 2005 18:39, Tom Rini wrote:
> The existing hook from KDB in the IPI code is really just a hook for the
> NMI vector.  We rename the vector thusly and then it's up to the
> debugger to handle things from do_default_nmi().

Jan Beulich pointed out some problems with this:

- First NMI vector is always 2 in the x86 architecture, so calling
another vector NMI_VECTOR is misleading.

- And when an NMI is forced in ICR the x86 architecture specifies
that the interrupt is delivered to vector 2.

Intel IA32  vol 3 8-23:

>>

100 (NMI) Delivers an NMI interrupt to the target processor
          or processors. The vector information is ignored.
<<

So how did this ever work?  I suspect you just got reentered
via the hooks in the NMI handler, but never through this vector.

I think I'll just remove this unless someone can explain how
it is supposed to work.

Thanks,
-Andi


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-09-09  8:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-08 16:39 [PATCH 2.6.13] x86_64: Rename KDB_VECTOR to NMI_VECTOR Tom Rini
2005-09-09  8:06 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox