Skip to contentSkip to conversation

x86, MCE: support raising machine check poll for software MCE injection in IRQ context

PATCH In review Chen Yucong 1 participant 2 messages Aug 12, 2014 – Sep 28, 2014 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86, MCE: support raising machine check poll for software MCE injection in IRQ context

At present MCJ_NMI_BROADCAST(same for raise_local) supports both raise_exception() and raise_poll(), but MCJ_IRQ_BROADCAST only supports raise_exception(). The goal of this patch is that MCJ_IRQ_BROADCAST can support raising machine check poll.

---
 arch/x86/kernel/cpu/mcheck/mce-inject.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/mcheck/mce-inject.c +6 -4
index 5ac2d1f..97e4f7a 100644
@@ -99,11 +99,13 @@ static void mce_irq_ipi(void *info)
 	int cpu = smp_processor_id();
 	struct mce *m = &__get_cpu_var(injectm);
 
-	if (cpumask_test_cpu(cpu, mce_inject_cpumask) &&
-			m->inject_flags & MCJ_EXCEPTION) {
-		cpumask_clear_cpu(cpu, mce_inject_cpumask);
+	if (!cpumask_test_cpu(cpu, mce_inject_cpumask))
+		return;
+	cpumask_clear_cpu(cpu, mce_inject_cpumask);
+	if (m->inject_flags & MCJ_EXCEPTION)
 		raise_exception(m, NULL);
-	}
+	else if (m->status)
+		raise_poll(m);
 }
 
 /* Inject mce on current CPU */
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 21 lines · Chen Yucong

At present MCJ_NMI_BROADCAST(same for raise_local) supports both raise_exception() and raise_poll(), but MCJ_IRQ_BROADCAST only supports raise_exception(). The goal of this patch is that MCJ_IRQ_BROADCAST can support raising machine check poll.

---
 arch/x86/kernel/cpu/mcheck/mce-inject.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/mcheck/mce-inject.c +1 -3
index 5ac2d1f..97e4f7a 100644
@@ -99,11 +99,13 @@ static void mce_irq_ipi(void *info)
 	int cpu = smp_processor_id();
 	struct mce *m = &__get_cpu_var(injectm);
 
-	if (cpumask_test_cpu(cpu, mce_inject_cpumask) &&
-			m->inject_flags & MCJ_EXCEPTION) {
-		cpumask_clear_cpu(cpu, mce_inject_cpumask);
+	if (!cpumask_test_cpu(cpu, mce_inject_cpumask))

arch/x86/kernel/cpu/mcheck/mce-inject.c static void mce_irq_ipi(void *info) · line 111

Quoted 10 lines
arch/x86/kernel/cpu/mcheck/mce-inject.c +5 -1
+		return;
+	cpumask_clear_cpu(cpu, mce_inject_cpumask);
+	if (m->inject_flags & MCJ_EXCEPTION)
 		raise_exception(m, NULL);
-	}
+	else if (m->status)
+		raise_poll(m);
 }
 
 /* Inject mce on current CPU */

Hi Chen Gong,

Can you review the above patch?

thx!
cyc