Skip to contentSkip to conversation

x86: dovetail: Use appropriate EOI on error interrupts

PATCH In review Jan Kiszka 3 participants 4 messages Jun 25, 2025 – Jul 8, 2025 x86

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 x86: dovetail: Use appropriate EOI on error interrupts

From: Jan Kiszka <[email protected]>

Just like for the non-pipelined spurious interrupt, we need to invoke the non-pipelined __apic_eoi while handling error interrupts. Otherwise, the local APIC will stop receiving further interrupts, and the system will stall.

Given that it takes very special conditions to actually trigger an error interrupt, this issue was very likely not relevant for most deployments.

---
 arch/x86/kernel/apic/apic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/apic/apic.c +1 -1
index 1cd5f59f7962f..278e28c5290d3 100644
@@ -2217,7 +2217,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_error_interrupt)
 	if (lapic_get_maxlvt() > 3)	/* Due to the Pentium erratum 3AP. */
 		apic_write(APIC_ESR, 0);
 	v = apic_read(APIC_ESR);
-	apic_eoi();
+	__apic_eoi();
 	atomic_inc(&irq_err_count);
 
 	apic_pr_debug("APIC error on CPU%d: %02x", smp_processor_id(), v);
Signature · 1 line
2.43.0
#1 lore raw
Quoted 9 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

Just like for the non-pipelined spurious interrupt, we need to invoke the non-pipelined __apic_eoi while handling error interrupts. Otherwise, the local APIC will stop receiving further interrupts, and the system will stall.

Given that it takes very special conditions to actually trigger an error interrupt, this issue was very likely not relevant for most deployments.

On which hardware is that happening? Asking because of

/*
* This interrupt should never happen with our APIC/SMP architecture */

infront of the function...

In addition we should properly check which branches are affected. apic_eoi() vs. ack_APIC_irq() (in 5.10),

Quoted 21 lines
---
 arch/x86/kernel/apic/apic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/apic/apic.c +1 -1
index 1cd5f59f7962f..278e28c5290d3 100644
@@ -2217,7 +2217,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_error_interrupt)
 	if (lapic_get_maxlvt() > 3)	/* Due to the Pentium erratum 3AP. */
 		apic_write(APIC_ESR, 0);
 	v = apic_read(APIC_ESR);
-	apic_eoi();
+	__apic_eoi();
 	atomic_inc(&irq_err_count);
 
 	apic_pr_debug("APIC error on CPU%d: %02x", smp_processor_id(), v);
Signature · 1 line
2.43.0
author
#2 lore raw
Quoted 11 lines · Florian Bezdeka
Quoted 9 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

Just like for the non-pipelined spurious interrupt, we need to invoke the non-pipelined __apic_eoi while handling error interrupts. Otherwise, the local APIC will stop receiving further interrupts, and the system will stall.

Given that it takes very special conditions to actually trigger an error interrupt, this issue was very likely not relevant for most deployments.

Quoted 8 lines

On which hardware is that happening? Asking because of

/*
* This interrupt should never happen with our APIC/SMP architecture */

infront of the function...

The user was very likely confronted with two errors at once: This one here, causing the visible problem of getting no more interrupts and the actual root cause of receiving an illegal IRQ vector on some core. The latter was most probably caused by the special software deployment there (half virtualization, half co-operative AMP).

Quoted 3 lines

In addition we should properly check which branches are affected. apic_eoi() vs. ack_APIC_irq() (in 5.10),

Yes, it's going down to 5.10 at least (where it is about __ack_APIC_irq). We have seen it with 5.10 in fact.

Jan

Quoted 21 lines
Quoted 21 lines
---
 arch/x86/kernel/apic/apic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/apic/apic.c +1 -1
index 1cd5f59f7962f..278e28c5290d3 100644
@@ -2217,7 +2217,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_error_interrupt)
 	if (lapic_get_maxlvt() > 3)	/* Due to the Pentium erratum 3AP. */
 		apic_write(APIC_ESR, 0);
 	v = apic_read(APIC_ESR);
-	apic_eoi();
+	__apic_eoi();
 	atomic_inc(&irq_err_count);
 
 	apic_pr_debug("APIC error on CPU%d: %02x", smp_processor_id(), v);
Signature · 1 line
2.43.0
Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center
#3 lore raw
In reply to Jan Kiszka
Quoted 20 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

Just like for the non-pipelined spurious interrupt, we need to invoke the non-pipelined __apic_eoi while handling error interrupts. Otherwise, the local APIC will stop receiving further interrupts, and the system will stall.

Given that it takes very special conditions to actually trigger an error interrupt, this issue was very likely not relevant for most deployments.

---
 arch/x86/kernel/apic/apic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/apic/apic.c +0 -0
index 1cd5f59f7962f..278e28c5290d3 100644

arch/x86/kernel/apic/apic.c DEFINE_IDTENTRY_SYSVEC(sysvec_error_interrupt) · line 2223

Quoted 8 lines
arch/x86/kernel/apic/apic.c +1 -1
@@ -2217,7 +2217,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_error_interrupt)
 	if (lapic_get_maxlvt() > 3)	/* Due to the Pentium erratum 3AP. */
 		apic_write(APIC_ESR, 0);
 	v = apic_read(APIC_ESR);
-	apic_eoi();
+	__apic_eoi();
 	atomic_inc(&irq_err_count);
 
 	apic_pr_debug("APIC error on CPU%d: %02x", smp_processor_id(), v);

Merged (v6.1.y [__ack_APIC_irq], v6.12.y, v6.15 and upcoming v6.16), thanks.

(short log fixed up slightly to ease commit identification on my end)

Signature · 1 line
Philippe.