linux/arch/x86/kernel/apic
Thomas Gleixner baedb87d1b genirq/affinity: Handle affinity setting on inactive interrupts correctly
Setting interrupt affinity on inactive interrupts is inconsistent when
hierarchical irq domains are enabled. The core code should just store the
affinity and not call into the irq chip driver for inactive interrupts
because the chip drivers may not be in a state to handle such requests.

X86 has a hacky workaround for that but all other irq chips have not which
causes problems e.g. on GIC V3 ITS.

Instead of adding more ugly hacks all over the place, solve the problem in
the core code. If the affinity is set on an inactive interrupt then:

    - Store it in the irq descriptors affinity mask
    - Update the effective affinity to reflect that so user space has
      a consistent view
    - Don't call into the irq chip driver

This is the core equivalent of the X86 workaround and works correctly
because the affinity setting is established in the irq chip when the
interrupt is activated later on.

Note, that this is only effective when hierarchical irq domains are enabled
by the architecture. Doing it unconditionally would break legacy irq chip
implementations.

For hierarchial irq domains this works correctly as none of the drivers can
have a dependency on affinity setting in inactive state by design.

Remove the X86 workaround as it is not longer required.

Fixes: 02edee152d ("x86/apic/vector: Ignore set_affinity call for inactive interrupts")
Reported-by: Ali Saidi <alisaidi@amazon.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Ali Saidi <alisaidi@amazon.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200529015501.15771-1-alisaidi@amazon.com
Link: https://lkml.kernel.org/r/877dv2rv25.fsf@nanos.tec.linutronix.de
2020-07-17 23:30:43 +02:00
..
apic.c The X86 entry, exception and interrupt code rework 2020-06-13 10:05:47 -07:00
apic_common.c x86/apic: Fix signedness bug in APIC ID validity checks 2018-04-10 16:46:39 +02:00
apic_flat_64.c x86/apic/flat64: Remove the IPI shorthand decision logic 2019-07-25 16:12:02 +02:00
apic_noop.c x86/apic: Cleanup the include maze 2019-07-25 16:11:57 +02:00
apic_numachip.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
bigsmp_32.c Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-09-17 12:04:39 -07:00
hw_nmi.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
io_apic.c irqdomain/treewide: Keep firmware node unconditionally allocated 2020-07-14 17:44:42 +02:00
ipi.c x86/apic: Share common IPI helpers 2019-07-25 16:12:02 +02:00
local.h x86/apic/x2apic: Implement IPI shorthands support 2019-07-25 16:12:02 +02:00
Makefile x86/PCI: Remove unused HyperTransport interrupt support 2017-11-23 20:18:18 +01:00
msi.c irqdomain/treewide: Keep firmware node unconditionally allocated 2020-07-14 17:44:42 +02:00
probe_32.c Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-09-17 12:04:39 -07:00
probe_64.c x86/apic/flat64: Remove the IPI shorthand decision logic 2019-07-25 16:12:02 +02:00
vector.c genirq/affinity: Handle affinity setting on inactive interrupts correctly 2020-07-17 23:30:43 +02:00
x2apic_cluster.c x86/apic/x2apic: Fix a NULL pointer deref when handling a dying cpu 2019-10-15 10:57:09 +02:00
x2apic_phys.c x86/apic/x2apic: Implement IPI shorthands support 2019-07-25 16:12:02 +02:00
x2apic_uv_x.c x86/apic/uv: Remove code for unused distributed GRU mode 2020-05-23 16:19:57 +02:00