public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] add and handle NMI_VECTOR
@ 2005-09-08 16:07 Jan Beulich
  2005-09-09  0:20 ` [discuss] " Andi Kleen
  2005-09-09  8:50 ` [discuss] [PATCH] add and handle NMI_VECTOR Andi Kleen
  0 siblings, 2 replies; 11+ messages in thread
From: Jan Beulich @ 2005-09-08 16:07 UTC (permalink / raw)
  To: Andreas Kleen; +Cc: linux-kernel, discuss

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

(Note: Patch also attached because the inline version is certain to get
line wrapped.)

Declare NMI_VECTOR and handle it in the IPI sending code.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

diff -Npru 2.6.13/include/asm-x86_64/hw_irq.h
2.6.13-x86_64-nmi-ipi/include/asm-x86_64/hw_irq.h
--- 2.6.13/include/asm-x86_64/hw_irq.h	2005-08-29 01:41:01.000000000
+0200
+++ 2.6.13-x86_64-nmi-ipi/include/asm-x86_64/hw_irq.h	2005-03-16
12:24:42.000000000 +0100
@@ -26,6 +26,7 @@
 struct hw_interrupt_type;
 #endif
 
+#define NMI_VECTOR		0x02
 /*
  * IDT vectors usable for external interrupt sources start
  * at 0x20:
diff -Npru 2.6.13/include/asm-x86_64/ipi.h
2.6.13-x86_64-nmi-ipi/include/asm-x86_64/ipi.h
--- 2.6.13/include/asm-x86_64/ipi.h	2005-08-29 01:41:01.000000000
+0200
+++ 2.6.13-x86_64-nmi-ipi/include/asm-x86_64/ipi.h	2005-09-01
11:32:12.000000000 +0200
@@ -31,9 +31,20 @@
 
 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)
-		icr = (icr & (~APIC_VECTOR_MASK)) | APIC_DM_NMI;
+	unsigned int icr = shortcut | dest;
+
+	switch (vector) {
+	default:
+		icr |= APIC_DM_FIXED | vector;
+		break;
+	case NMI_VECTOR:
+		/*
+		 * Setup KDB IPI to be delivered as an NMI
+		 */
+	case KDB_VECTOR:
+		icr |= APIC_DM_NMI;
+		break;
+	}
 	return icr;
 }
 


[-- Attachment #2: linux-2.6.13-x86_64-nmi-ipi.patch --]
[-- Type: application/octet-stream, Size: 1398 bytes --]

(Note: Patch also attached because the inline version is certain to get
line wrapped.)

Declare NMI_VECTOR and handle it in the IPI sending code.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

diff -Npru 2.6.13/include/asm-x86_64/hw_irq.h 2.6.13-x86_64-nmi-ipi/include/asm-x86_64/hw_irq.h
--- 2.6.13/include/asm-x86_64/hw_irq.h	2005-08-29 01:41:01.000000000 +0200
+++ 2.6.13-x86_64-nmi-ipi/include/asm-x86_64/hw_irq.h	2005-03-16 12:24:42.000000000 +0100
@@ -26,6 +26,7 @@
 struct hw_interrupt_type;
 #endif
 
+#define NMI_VECTOR		0x02
 /*
  * IDT vectors usable for external interrupt sources start
  * at 0x20:
diff -Npru 2.6.13/include/asm-x86_64/ipi.h 2.6.13-x86_64-nmi-ipi/include/asm-x86_64/ipi.h
--- 2.6.13/include/asm-x86_64/ipi.h	2005-08-29 01:41:01.000000000 +0200
+++ 2.6.13-x86_64-nmi-ipi/include/asm-x86_64/ipi.h	2005-09-01 11:32:12.000000000 +0200
@@ -31,9 +31,20 @@
 
 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)
-		icr = (icr & (~APIC_VECTOR_MASK)) | APIC_DM_NMI;
+	unsigned int icr = shortcut | dest;
+
+	switch (vector) {
+	default:
+		icr |= APIC_DM_FIXED | vector;
+		break;
+	case NMI_VECTOR:
+		/*
+		 * Setup KDB IPI to be delivered as an NMI
+		 */
+	case KDB_VECTOR:
+		icr |= APIC_DM_NMI;
+		break;
+	}
 	return icr;
 }
 

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

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

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-08 16:07 [PATCH] add and handle NMI_VECTOR Jan Beulich
2005-09-09  0:20 ` [discuss] " Andi Kleen
2005-09-09  0:43   ` [discuss] [PATCH] add and handle NMI_VECTOR II Andi Kleen
2005-09-09  6:42     ` Jan Beulich
2005-09-09  6:55       ` Andi Kleen
2005-09-09  7:13         ` Jan Beulich
2005-09-09  7:14           ` Andi Kleen
2005-09-09  7:57             ` Jan Beulich
2005-09-09  7:58               ` Andi Kleen
2005-09-09  8:50 ` [discuss] [PATCH] add and handle NMI_VECTOR Andi Kleen
2005-09-09  9:14   ` Jan Beulich

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