Skip to content

Commit

Permalink
x86, mce, cmci: avoid potential reentry of threshold interrupt
Browse files Browse the repository at this point in the history
Impact: minor bugfix

The threshold handler on AMD (and soon on Intel) could be theoretically
reentered by the hardware. This could lead to corrupted events
because the machine check poll code assumes it is not reentered.

Move the APIC ACK to the end of the interrupt handler to let
the hardware avoid that.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
Andi Kleen authored and H. Peter Anvin committed Feb 24, 2009
1 parent b276268 commit f9695df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kernel/cpu/mcheck/threshold.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ void (*mce_threshold_vector)(void) = default_threshold_interrupt;

asmlinkage void mce_threshold_interrupt(void)
{
ack_APIC_irq();
exit_idle();
irq_enter();
inc_irq_stat(irq_threshold_count);
mce_threshold_vector();
irq_exit();
/* Ack only at the end to avoid potential reentry */
ack_APIC_irq();
}

0 comments on commit f9695df

Please sign in to comment.