genirq: Allow per-cpu interrupt sharing for non-overlapping affinities
authorMarc Zyngier <maz@kernel.org>
Mon, 20 Oct 2025 12:29:33 +0000 (13:29 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 27 Oct 2025 16:16:35 +0000 (17:16 +0100)
commitbdf4e2ac295fe77c94b570a1ad12c0882bc89b53
tree396d68c5c10c6d37b2c9efa162171c4b665acedf
parentb9c6aa9efc71dae656f9f913d1250ea08cd6e10f
genirq: Allow per-cpu interrupt sharing for non-overlapping affinities

Interrupt sharing for percpu-devid interrupts is forbidden, and for good
reasons. These are interrupts generated *from* a CPU and handled by itself
(timer, for example). Nobody in their right mind would put two devices on
the same pin (and if they have, they get to keep the pieces...).

But this also prevents more benign cases, where devices are connected
to groups of CPUs, and for which the affinities are not overlapping.
Effectively, the only thing they share is the interrupt number, and
nothing else.

Tweak the definition of IRQF_SHARED applied to percpu_devid interrupts to
allow this particular use case. This results in extra validation at the
point of the interrupt being setup and freed, as well as a tiny bit of
extra complexity for interrupts at handling time (to pick the correct
irqaction).

Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Will Deacon <will@kernel.org>
Link: https://patch.msgid.link/20251020122944.3074811-17-maz@kernel.org
kernel/irq/chip.c
kernel/irq/manage.c