genirq: Add protection against unsafe usage of generic_handle_irq()
authorThomas Gleixner <tglx@linutronix.de>
Fri, 6 Mar 2020 13:03:43 +0000 (14:03 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 8 Mar 2020 10:06:40 +0000 (11:06 +0100)
commitc16816acd08697b02a53f56f8936497a9f6f6e7a
treeb1862c5ad099bf0324e042dd2984f6730795472a
parenta740a423c36932695b01a3e920f697bc55b05fec
genirq: Add protection against unsafe usage of generic_handle_irq()

In general calling generic_handle_irq() with interrupts disabled from non
interrupt context is harmless. For some interrupt controllers like the x86
trainwrecks this is outright dangerous as it might corrupt state if an
interrupt affinity change is pending.

Add infrastructure which allows to mark interrupts as unsafe and catch such
usage in generic_handle_irq().

Reported-by: sathyanarayanan.kuppuswamy@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lkml.kernel.org/r/20200306130623.590923677@linutronix.de
include/linux/irq.h
kernel/irq/internals.h
kernel/irq/irqdesc.c
kernel/irq/resend.c