linux/arch/x86/kernel/apic
Suresh Siddha 68a8ca593f x86: fix broken irq migration logic while cleaning up multiple vectors
Impact: fix spurious IRQs

During irq migration, we send a low priority interrupt to the previous
irq destination. This happens in non interrupt-remapping case after interrupt
starts arriving at new destination and in interrupt-remapping case after
modifying and flushing the interrupt-remapping table entry caches.

This low priority irq cleanup handler can cleanup multiple vectors, as
multiple irq's can be migrated at almost the same time. While
there will be multiple invocations of irq cleanup handler (one cleanup
IPI for each irq migration), first invocation of the cleanup handler
can potentially cleanup more than one vector (as the first invocation can
see the requests for more than vector cleanup). When we cleanup multiple
vectors during the first invocation of the smp_irq_move_cleanup_interrupt(),
other vectors that are to be cleanedup can still be pending in the local
cpu's IRR (as smp_irq_move_cleanup_interrupt() runs with interrupts disabled).

When we are ready to unhook a vector corresponding to an irq, check if that
vector is registered in the local cpu's IRR. If so skip that cleanup and
do a self IPI with the cleanup vector, so that we give a chance to
service the pending vector interrupt and then cleanup that vector
allocation once we execute the lowest priority handler.

This fixes spurious interrupts seen when migrating multiple vectors
at the same time.

[ This is apparently possible even on conventional xapic, although to
  the best of our knowledge it has never been seen.  The stable
  maintainers may wish to consider this one for -stable. ]

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: stable@kernel.org
2009-03-17 16:49:30 -07:00
..
apic_flat_64.c x86: apic: simplify secondary CPU wakeup methods 2009-02-26 13:58:26 +01:00
apic.c x86, ioapic: Fix non atomic allocation with interrupts disabled 2009-03-17 15:45:29 -07:00
bigsmp_32.c x86_32: apic/bigsmp_32, de-inline functions 2009-03-02 11:20:32 +01:00
es7000_32.c x86_32: apic/es7000_32, fix section mismatch 2009-03-02 12:00:24 +01:00
io_apic.c x86: fix broken irq migration logic while cleaning up multiple vectors 2009-03-17 16:49:30 -07:00
ipi.c
Makefile x86, apic: separate 32-bit setup functionality out of apic_32.c 2009-02-17 23:12:48 +01:00
nmi.c
numaq_32.c x86_32: apic/numaq_32, fix section mismatch 2009-03-02 12:00:25 +01:00
probe_32.c x86: apic: simplify secondary CPU wakeup methods 2009-02-26 13:58:26 +01:00
probe_64.c x86, x2apic: cleanup ifdef CONFIG_INTR_REMAP in io_apic code 2009-03-17 15:45:07 -07:00
summit_32.c x86_32: apic/summit_32, fix section mismatch 2009-03-02 12:00:25 +01:00
x2apic_cluster.c x86: apic: simplify secondary CPU wakeup methods 2009-02-26 13:58:26 +01:00
x2apic_phys.c x86: apic: simplify secondary CPU wakeup methods 2009-02-26 13:58:26 +01:00
x2apic_uv_x.c x86: apic: simplify secondary CPU wakeup methods, fix 2009-02-26 14:11:06 +01:00