kernel_optimize_test/drivers/irqchip
Marc Zyngier ed423d80bb irqchip/gic-v3: Workaround inconsistent PMR setting on NMI entry
[ Upstream commit 382e6e177bc1c02473e56591fe5083ae1e4904f6 ]

The arm64 entry code suffers from an annoying issue on taking
a NMI, as it sets PMR to a value that actually allows IRQs
to be acknowledged. This is done for consistency with other parts
of the code, and is in the process of being fixed. This shouldn't
be a problem, as we are not enabling interrupts whilst in NMI
context.

However, in the infortunate scenario that we took a spurious NMI
(retired before the read of IAR) *and* that there is an IRQ pending
at the same time, we'll ack the IRQ in NMI context. Too bad.

In order to avoid deadlocks while running something like perf,
teach the GICv3 driver about this situation: if we were in
a context where no interrupt should have fired, transiently
set PMR to a value that only allows NMIs before acking the pending
interrupt, and restore the original value after that.

This papers over the core issue for the time being, and makes
NMIs great again. Sort of.

Fixes: 4d6a38da8e79e94c ("arm64: entry: always set GIC_PRIO_PSR_I_SET during entry")
Co-developed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/lkml/20210610145731.1350460-1-maz@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-23 14:42:49 +02:00
..
alphascale_asm9260-icoll.h
exynos-combiner.c
irq-al-fic.c
irq-alpine-msi.c irqchip/alpine-msi: Fix freeing of interrupts on allocation error path 2020-12-30 11:53:50 +01:00
irq-armada-370-xp.c irqchip/armada-370-xp: Configure IPIs as standard interrupts 2020-09-17 16:37:27 +01:00
irq-aspeed-i2c-ic.c
irq-aspeed-scu-ic.c irqchip: Add Aspeed SCU interrupt controller 2020-01-20 19:10:04 +00:00
irq-aspeed-vic.c
irq-ath79-cpu.c
irq-ath79-misc.c
irq-ativic32.c irqchip/ativic32: Constify irq_domain_ops 2020-07-27 08:55:02 +01:00
irq-atmel-aic-common.c
irq-atmel-aic-common.h
irq-atmel-aic.c irqchip/atmel-aic: Fix irq_retrigger callback return value 2020-03-16 15:48:54 +00:00
irq-atmel-aic5.c irqchip/atmel-aic5: Add support for sam9x60 rtt fixup 2020-06-27 11:55:45 +01:00
irq-bcm2835.c irqchip/bcm2835: Quiesce IRQs left enabled by bootloader 2020-03-16 15:48:54 +00:00
irq-bcm2836.c irqchip/bcm2836: Fix missing __init annotation 2020-10-25 11:10:29 +00:00
irq-bcm6345-l1.c
irq-bcm7038-l1.c irqchip/irq-bcm7038-l1: Guard uses of cpu_logical_map 2020-07-27 08:55:03 +01:00
irq-bcm7120-l2.c irqchip/bcm7120-l2: Set controller as wake-up source 2020-07-17 13:41:42 +01:00
irq-brcmstb-l2.c irqchip/brcmstb-l2: Match UPG_AUX_AON_INTR2 compatible 2020-07-17 13:41:42 +01:00
irq-clps711x.c
irq-crossbar.c
irq-csky-apb-intc.c
irq-csky-mpintc.c
irq-davinci-aintc.c
irq-davinci-cp-intc.c
irq-digicolor.c
irq-dw-apb-ictl.c irqchip/dw-apb-ictl: Add primary interrupt controller support 2020-09-25 16:49:14 +01:00
irq-eznps.c
irq-ftintc010.c
irq-gic-common.c irqchip/gic-common: Don't enable SGIs by default 2020-09-17 16:37:27 +01:00
irq-gic-common.h
irq-gic-pm.c
irq-gic-realview.c
irq-gic-v2m.c
irq-gic-v3-its-fsl-mc-msi.c bus: fsl-mc: Add ACPI support for fsl-mc 2020-07-28 15:51:32 +01:00
irq-gic-v3-its-pci-msi.c
irq-gic-v3-its-platform-msi.c
irq-gic-v3-its.c irqchip fixes for Linux 5.10, take #2 2020-11-25 00:56:28 +01:00
irq-gic-v3-mbi.c irqchip/gic-v3: Fix OF_BAD_ADDR error handling 2021-05-14 09:50:15 +02:00
irq-gic-v3.c irqchip/gic-v3: Workaround inconsistent PMR setting on NMI entry 2021-06-23 14:42:49 +02:00
irq-gic-v4.c irqchip/gic-v4.1: Add VSGI property setup 2020-03-24 12:15:51 +00:00
irq-gic.c Merge remote-tracking branch 'origin/irq/gic-retrigger' into irq/irqchip-next 2020-09-17 16:50:02 +01:00
irq-goldfish-pic.c
irq-hip04.c irqchip/hip04: Configure IPIs as standard interrupts 2020-09-17 16:37:27 +01:00
irq-i8259.c irqchip: Replace setup_irq() by request_irq() 2020-03-08 14:25:46 +00:00
irq-imgpdc.c
irq-imx-gpcv2.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
irq-imx-intmux.c irqchip/imx-intmux: Use dev_err_probe() to simplify error handling 2020-09-13 17:38:52 +01:00
irq-imx-irqsteer.c irqchip/imx-irqsteer: Use dev_err_probe() to simplify error handling 2020-09-13 17:38:52 +01:00
irq-ingenic-tcu.c irqchip/ingenic: Add support for the JZ4760 2021-03-30 14:31:50 +02:00
irq-ingenic.c irqchip/ingenic: Add support for the JZ4760 2021-03-30 14:31:50 +02:00
irq-ixp4xx.c
irq-jcore-aic.c
irq-keystone.c
irq-loongson-htpic.c irqchip/loongson-htpic: Remove redundant kfree operation 2020-07-17 13:41:42 +01:00
irq-loongson-htvec.c irqchip/loongson-htvec: Fix initial interrupt clearing 2020-09-13 15:30:11 +01:00
irq-loongson-liointc.c irqchip/loongson-liointc: Fix misuse of gc->mask_cache 2020-07-30 12:57:51 +01:00
irq-loongson-pch-msi.c irqchip/loongson-pch-msi: Use bitmap_zalloc() to allocate bitmap 2021-03-04 11:38:42 +01:00
irq-loongson-pch-pic.c irqchip/loongson-pch-pic: Fix the misused irq flow handler 2020-07-30 12:58:17 +01:00
irq-lpc32xx.c
irq-ls-extirq.c
irq-ls-scfg-msi.c
irq-ls1x.c
irq-madera.c
irq-mbigen.c irqchip/mbigen: Free msi_desc on device teardown 2020-04-17 08:59:27 +01:00
irq-meson-gpio.c irqchip/meson-gpio: Fix HARDIRQ-safe -> HARDIRQ-unsafe lock order 2020-04-17 08:59:29 +01:00
irq-mips-cpu.c irqchip/mips-cpu: Set IPI domain parent chip 2021-01-27 11:55:13 +01:00
irq-mips-gic.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
irq-mmp.c
irq-mscc-ocelot.c
irq-mst-intc.c irqchip/mst: Make mst_intc_of_init static 2020-10-15 22:32:31 +01:00
irq-mtk-cirq.c irqchip: Revert modular support for drivers using IRQCHIP_PLATFORM_DRIVER helperse 2020-08-25 10:48:54 +01:00
irq-mtk-sysirq.c irqchip: Revert modular support for drivers using IRQCHIP_PLATFORM_DRIVER helperse 2020-08-25 10:48:54 +01:00
irq-mvebu-gicp.c
irq-mvebu-icu.c irqchip/irq-mvebu-icu: Make legacy_bindings static 2020-04-17 08:59:29 +01:00
irq-mvebu-odmi.c
irq-mvebu-pic.c
irq-mvebu-sei.c
irq-mxs.c
irq-nvic.c irqchip/nvic: Use irq_domain_translate_onecell instead of custom func 2020-01-20 09:24:47 +00:00
irq-omap-intc.c
irq-ompic.c
irq-or1k-pic.c
irq-orion.c
irq-owl-sirq.c irqchip: Add Actions Semi Owl SIRQ controller 2020-09-25 16:57:33 +01:00
irq-partition-percpu.c
irq-pic32-evic.c
irq-pruss-intc.c irqchip/irq-pruss-intc: Add support for ICSSG INTC on K3 SoCs 2020-09-17 12:20:32 +01:00
irq-rda-intc.c
irq-renesas-h8s.c
irq-renesas-h8300h.c
irq-renesas-intc-irqpin.c irqchip/renesas-intc-irqpin: Merge irlm_bit and needs_irlm 2020-11-01 11:59:22 +00:00
irq-renesas-irqc.c
irq-renesas-rza1.c
irq-riscv-intc.c irqchip/riscv-intc: Fix a typo in a pr_warn() 2020-06-21 15:15:41 +01:00
irq-sa11x0.c
irq-sifive-plic.c irqchip/sifive-plic: Fix chip_data access within a hierarchy 2020-11-01 11:52:27 +00:00
irq-sirfsoc.c
irq-sl28cpld.c irqchip: Add sl28cpld interrupt controller support 2020-09-17 15:58:37 +01:00
irq-sni-exiu.c irqchip/exiu: Fix the index of fwspec for IRQ type 2020-11-22 10:27:23 +00:00
irq-st.c
irq-stm32-exti.c irqchip/stm32-exti: Add all LP timer exti direct events support 2020-10-25 12:04:13 +00:00
irq-sun4i.c
irq-sunxi-nmi.c
irq-tango.c
irq-tb10x.c
irq-tegra.c
irq-ti-sci-inta.c irqchip/ti-sci-inta: Fix printing of inta id on probe success 2020-12-30 11:53:50 +01:00
irq-ti-sci-intr.c irqchip/ti-sci-intr: Fix freeing of irqs 2020-12-30 11:53:50 +01:00
irq-ts4800.c
irq-uniphier-aidet.c
irq-versatile-fpga.c irqchip/versatile-fpga: Apply clear-mask earlier 2020-03-22 11:52:16 +00:00
irq-vf610-mscm-ir.c
irq-vic.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
irq-vt8500.c
irq-xilinx-intc.c Revert "irqchip/xilinx: Enable generic irq multi handler" 2020-04-01 09:12:24 +01:00
irq-xtensa-mx.c
irq-xtensa-pic.c
irq-zevio.c
irqchip.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
Kconfig irqchip/imx: IMX_INTMUX should not default to y, unconditionally 2021-03-04 11:37:51 +01:00
Makefile ARM: SoC platform updates 2020-10-24 10:33:08 -07:00
qcom-irq-combiner.c irqchip/qcom-irq-combiner: Replace zero-length array with flexible-array member 2020-03-22 11:52:52 +00:00
qcom-pdc.c irqchip/qcom-pdc: Fix phantom irq when changing between rising/falling 2020-12-30 11:53:51 +01:00
spear-shirq.c