Skip to contentSkip to conversation

x86, UV: uv_hub_send_ipi Needs to set DELIVERY_MODE=4 for vector=NMI_VECTOR.

PATCH In review Robin Holt 2 participants 3 messages Oct 19, 2009 – Oct 20, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Robin Holt

author
#1 lore raw

PATCH 1/1 x86, UV: uv_hub_send_ipi Needs to set DELIVERY_MODE=4 for vector=NMI_VECTOR.

When sending a NMI_VECTOR IPI using the UV_HUB_IPI_INT register, we need to ensure the delivery mode field of that register has NMI delivery selected.

To: Ingo Molnar <[email protected]>
To: [email protected]

---
 arch/x86/include/asm/uv/uv_hub.h |    6 ++++++
 1 file changed, 6 insertions(+)
arch/x86/include/asm/uv/uv_hub.h +6 -0
Index: linux-x86/arch/x86/include/asm/uv/uv_hub.h
===================================================================
@@ -19,6 +19,7 @@
 #include <asm/types.h>
 #include <asm/percpu.h>
 #include <asm/uv/uv_mmrs.h>
+#include <asm/irq_vectors.h>
 
 
 /*
@@ -435,9 +436,14 @@ static inline void uv_set_cpu_scir_bits(
 static inline void uv_hub_send_ipi(int pnode, int apicid, int vector)
 {
 	unsigned long val;
+	unsigned long dmode = 0; /* Directed Delivery */
+
+	if (vector == NMI_VECTOR)
+		dmode = 4; /* NMI Delivery */
 
 	val = (1UL << UVH_IPI_INT_SEND_SHFT) |
 			((apicid) << UVH_IPI_INT_APIC_ID_SHFT) |
+			(dmode << UVH_IPI_INT_DELIVERY_MODE_SHFT) |
 			(vector << UVH_IPI_INT_VECTOR_SHFT);
 	uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
 }
#2 lore raw
Quoted 31 lines · Robin Holt

When sending a NMI_VECTOR IPI using the UV_HUB_IPI_INT register, we need to ensure the delivery mode field of that register has NMI delivery selected.

To: Ingo Molnar <[email protected]>
To: [email protected]

---
 arch/x86/include/asm/uv/uv_hub.h |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux-x86/arch/x86/include/asm/uv/uv_hub.h
===================================================================

arch/x86/include/asm/uv/uv_hub.h +1 -0
@@ -19,6 +19,7 @@
 #include <asm/types.h>
 #include <asm/percpu.h>
 #include <asm/uv/uv_mmrs.h>
+#include <asm/irq_vectors.h>
 
 
 /*
@@ -435,9 +436,14 @@ static inline void uv_set_cpu_scir_bits(
 static inline void uv_hub_send_ipi(int pnode, int apicid, int vector)
 {
 	unsigned long val;

arch/x86/include/asm/uv/uv_hub.h static inline void uv_set_cpu_scir_bits( · line 448

Quoted 10 lines
arch/x86/include/asm/uv/uv_hub.h +5 -0
+	unsigned long dmode = 0; /* Directed Delivery */
+
+	if (vector == NMI_VECTOR)
+		dmode = 4; /* NMI Delivery */
 
 	val = (1UL << UVH_IPI_INT_SEND_SHFT) |
 			((apicid) << UVH_IPI_INT_APIC_ID_SHFT) |
+			(dmode << UVH_IPI_INT_DELIVERY_MODE_SHFT) |
 			(vector << UVH_IPI_INT_VECTOR_SHFT);
 	uv_write_global_mmr64(pnode, UVH_IPI_INT, val);

Hm, would be cleaner to create an enum for that '4' (and for 0) in uv_mmrs.h and use it here. (We have similar constants for delivery modes in io_apic.h, see dest_*.)

Ingo

author
#3 lore raw
Quoted 3 lines · Ingo Molnar

Hm, would be cleaner to create an enum for that '4' (and for 0) in uv_mmrs.h and use it here. (We have similar constants for delivery modes in io_apic.h, see dest_*.)

I will send another patch shortly. This register has delivery modes modeled after the io_apic.

Robin