linux/arch/powerpc/sysdev
Cédric Le Goater 6f779e1d35 powerpc/xive: Discard disabled interrupts in get_irqchip_state()
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
2021-10-13 16:38:55 +11:00
..
ge treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
xics powerpc/xics: Set the IRQ chip data for the ICS native backend 2021-09-15 22:05:53 +10:00
xive powerpc/xive: Discard disabled interrupts in get_irqchip_state() 2021-10-13 16:38:55 +11:00
6xx-suspend.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cpm2_pic.c
cpm2_pic.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpm2.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
cpm_common.c powerpc/8xx: Don't set IMMR map anymore at boot 2020-05-26 22:22:21 +10:00
cpm_gpio.c powerpc: cpm_gpio: Remove owner assignment from platform_driver 2018-06-03 20:43:35 +10:00
dart_iommu.c powerpc/iommu: Do not immediately panic when failed IOMMU table allocation 2021-04-23 01:38:04 +10:00
dart.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
dcr-low.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
dcr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ehv_pic.c powerpc: Add missing linux/{of.h,irqdomain.h} include directives 2021-06-10 13:09:16 +01:00
fsl_85xx_cache_ctlr.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
fsl_85xx_cache_sram.c mm: introduce include/linux/pgtable.h 2020-06-09 09:39:13 -07:00
fsl_85xx_l2ctlr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
fsl_gtm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fsl_lbc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fsl_mpic_err.c powerpc: Bulk conversion to generic_handle_domain_irq() 2021-08-10 23:15:02 +10:00
fsl_mpic_timer_wakeup.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fsl_msi.c powerpc: Bulk conversion to generic_handle_domain_irq() 2021-08-10 23:15:02 +10:00
fsl_msi.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
fsl_pci.c powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
fsl_pci.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fsl_pmc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fsl_rcpm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fsl_rio.c powerpc: Refactor verification of MSR_RI 2021-08-26 21:21:07 +10:00
fsl_rio.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fsl_rmu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fsl_soc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fsl_soc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
grackle.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
i8259.c powerpc: Convert irq_domain_add_legacy_isa use to irq_domain_add_legacy 2021-06-10 13:09:16 +01:00
indirect_pci.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ipic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ipic.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
Kconfig powerpc/powernv: Move SCOM access code into powernv platform 2019-08-05 18:53:03 +10:00
Makefile powerpc: Remove Xilinx PPC405/PPC440 support 2020-05-28 23:24:34 +10:00
mmio_nvram.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 153 2019-05-30 11:26:32 -07:00
mpc5xxx_clocks.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mpic_msgr.c powerpc: sysdev: add missing iounmap() on error in mpic_msgr_probe() 2020-11-19 14:50:14 +11:00
mpic_msi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
mpic_timer.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
mpic_u3msi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
mpic.c powerpc: Convert irq_domain_add_legacy_isa use to irq_domain_add_legacy 2021-06-10 13:09:16 +01:00
mpic.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
msi_bitmap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
of_rtc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pmi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 153 2019-05-30 11:26:32 -07:00
rtc_cmos_setup.c
tsi108_dev.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
tsi108_pci.c powerpc: Convert irq_domain_add_legacy_isa use to irq_domain_add_legacy 2021-06-10 13:09:16 +01:00
udbg_memcons.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00