irqchip/gic-v3: Enable support for SGIs to act as NMIs
authorDouglas Anderson <dianders@chromium.org>
Wed, 6 Sep 2023 16:02:56 +0000 (09:02 -0700)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 25 Sep 2023 16:15:28 +0000 (17:15 +0100)
commita02026bf9da13cd44fb444857d5aebc934e1af5a
treebaf72a609dbaa6e1e2912c0fa52733a201dc1f56
parent6465e260f48790807eef06b583b38ca9789b6072
irqchip/gic-v3: Enable support for SGIs to act as NMIs

As of commit 6abbd6988971 ("irqchip/gic, gic-v3: Make SGIs use
handle_percpu_devid_irq()") SGIs are treated the same as PPIs/EPPIs
and use handle_percpu_devid_irq() by default. Unfortunately,
handle_percpu_devid_irq() isn't NMI safe, and so to run in an NMI
context those should use handle_percpu_devid_fasteoi_nmi().

In order to accomplish this, we just have to make room for SGIs in the
array of refcounts that keeps track of which interrupts are set as
NMI. We also rename the array and create a new indexing scheme that
accounts for SGIs.

Also, enable NMI support prior to gic_smp_init() as allocation of SGIs
as IRQs/NMIs happen as part of this routine.

Co-developed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230906090246.v13.1.I1223c11c88937bd0cbd9b086d4ef216985797302@changeid
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
drivers/irqchip/irq-gic-v3.c