linux-uconsole/arch/powerpc/sysdev/xive
Cédric Le Goater ea947267eb powerpc/xive: Discard disabled interrupts in get_irqchip_state()
commit 6f779e1d35 upstream.

When an interrupt is passed through, the KVM XIVE device calls the
set_vcpu_affinity() handler which raises the P bit to mask the
interrupt and to catch any in-flight interrupts while routing the
interrupt to the guest.

On the guest side, drivers (like some Intels) can request at probe
time some MSIs and call synchronize_irq() to check that there are no
in flight interrupts. This will call the XIVE get_irqchip_state()
handler which will always return true as the interrupt P bit has been
set on the host side and lock the CPU in an infinite loop.

Fix that by discarding disabled interrupts in get_irqchip_state().

Fixes: da15c03b04 ("powerpc/xive: Implement get_irqchip_state method for XIVE to fix shutdown race")
Cc: stable@vger.kernel.org #v5.4+
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Tested-by: seeteena <s1seetee@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211011070203.99726-1-clg@kaod.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-20 11:45:01 +02:00
..
common.c powerpc/xive: Discard disabled interrupts in get_irqchip_state() 2021-10-20 11:45:01 +02:00
Kconfig powerpc: remove redundant 'default n' from Kconfig-s 2018-10-13 22:21:25 +11:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
native.c powerpc/xive: Ignore kmemleak false positives 2020-06-22 10:37:57 +10:00
spapr.c powerpc: fix function annotations to avoid section mismatch warnings with gcc-10 2020-07-30 10:50:07 +10:00
xive-internal.h powerpc/xive: Add a debugfs file to dump internal XIVE state 2020-03-27 00:20:38 +11:00