Skip to contentSkip to conversation

x86: apic unification - merge down enable_NMI_through_LVT0

PATCH New Cyrill Gorcunov 1 participant 2 messages Jul 24, 2008 1 message not in the archive x86

lore
Share & tools
lore

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

#1 lore raw

PATCH 1/2 x86: apic unification - merge down lapic_get_maxlvt

---

No code change on binary level.

arch/x86/kernel/apic_32.c +6 -2
Index: linux-2.6.git/arch/x86/kernel/apic_32.c
===================================================================
@@ -226,9 +226,13 @@ int get_physical_broadcast(void)
  */
 int lapic_get_maxlvt(void)
 {
-	unsigned int v = apic_read(APIC_LVR);
+	unsigned int v;
 
-	/* 82489DXs do not report # of LVT entries. */
+	v = apic_read(APIC_LVR);
+	/*
+	 * - we always have APIC integrated on 64bit mode
+	 * - 82489DXs do not report # of LVT entries
+	 */
 	return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2;
 }
 
arch/x86/kernel/apic_64.c +6 -3
Index: linux-2.6.git/arch/x86/kernel/apic_64.c
===================================================================
@@ -228,11 +228,14 @@ void __cpuinit enable_NMI_through_LVT0(v
  */
 int lapic_get_maxlvt(void)
 {
-	unsigned int v, maxlvt;
+	unsigned int v;
 
 	v = apic_read(APIC_LVR);
-	maxlvt = GET_APIC_MAXLVT(v);
-	return maxlvt;
+	/*
+	 * - we always have APIC integrated on 64bit mode
+	 * - 82489DXs do not report # of LVT entries
+	 */
+	return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2;
 }
 
 /*
#2 lore raw

PATCH 2/2 x86: apic unification - merge down enable_NMI_through_LVT0

In reply to a message not in the archive

---

No code change on binary level.

arch/x86/kernel/apic_32.c +6 -2
Index: linux-2.6.git/arch/x86/kernel/apic_32.c
===================================================================
@@ -205,11 +205,15 @@ EXPORT_SYMBOL_GPL(apic_ops);
  */
 void __cpuinit enable_NMI_through_LVT0(void)
 {
-	unsigned int v = APIC_DM_NMI;
+	unsigned int v;
+
+	/* unmask and set to NMI */
+	v = APIC_DM_NMI;
 
-	/* Level triggered for 82489DX */
+	/* Level triggered for 82489DX (32bit mode) */
 	if (!lapic_is_integrated())
 		v |= APIC_LVT_LEVEL_TRIGGER;
+
 	apic_write(APIC_LVT0, v);
 }
 
arch/x86/kernel/apic_64.c +5 -0
Index: linux-2.6.git/arch/x86/kernel/apic_64.c
===================================================================
@@ -220,6 +220,11 @@ void __cpuinit enable_NMI_through_LVT0(v
 
 	/* unmask and set to NMI */
 	v = APIC_DM_NMI;
+
+	/* Level triggered for 82489DX (32bit mode) */
+	if (!lapic_is_integrated())
+		v |= APIC_LVT_LEVEL_TRIGGER;
+
 	apic_write(APIC_LVT0, v);
 }