[PATCH] irqchip/gic: Simplify Maintenance Interrupt ACPI parsing
Radu Rendec
radu at rendec.net
Sat Aug 1 11:22:50 PDT 2026
On Sat, 2026-07-25 at 16:59 +0100, Marc Zyngier wrote:
> The ACPI spec describes the vgic Maintenance Interrupt with attributes
> indicating whether the signalling is Level or Edge. While this
> superficially looks like a sensible thing to do, it doesn't actually
> make much sense.
>
> By construction, this interrupt is Level, and cannot be anything
> else, as the hypervisor actively needs to interact with the vgic
> for the level to drop. This indicates a state, and not an event.
>
> Get rid of this nonsense, always register the corresponding GSI as
> Level, and let the user know that they run on quality FW should
> the interrupt be advertised as Edge.
>
> Signed-off-by: Marc Zyngier <maz at kernel.org>
> ---
> drivers/irqchip/irq-gic-v3.c | 10 +++-------
> drivers/irqchip/irq-gic.c | 8 ++++----
> 2 files changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> index 99444a1b2ffa2..22ecd28a491a8 100644
> --- a/drivers/irqchip/irq-gic-v3.c
> +++ b/drivers/irqchip/irq-gic-v3.c
> @@ -2279,7 +2279,6 @@ static struct
> bool single_redist;
> int enabled_rdists;
> u32 maint_irq;
> - int maint_irq_mode;
> phys_addr_t vcpu_base;
> } acpi_data __initdata;
>
> @@ -2457,21 +2456,19 @@ static int __init gic_acpi_parse_virt_madt_gicc(union acpi_subtable_headers *hea
> {
> struct acpi_madt_generic_interrupt *gicc =
> (struct acpi_madt_generic_interrupt *)header;
> - int maint_irq_mode;
> static int first_madt = true;
>
> if (!(gicc->flags &
> (ACPI_MADT_ENABLED | ACPI_MADT_GICC_ONLINE_CAPABLE)))
> return 0;
>
> - maint_irq_mode = (gicc->flags & ACPI_MADT_VGIC_IRQ_MODE) ?
> - ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE;
> + if (gicc->flags & ACPI_MADT_VGIC_IRQ_MODE)
> + pr_warn_once(FW_BUG "MI wrongly advertised as Edge-triggered\n");
>
> if (first_madt) {
> first_madt = false;
>
> acpi_data.maint_irq = gicc->vgic_interrupt;
> - acpi_data.maint_irq_mode = maint_irq_mode;
> acpi_data.vcpu_base = gicc->gicv_base_address;
>
> return 0;
> @@ -2481,7 +2478,6 @@ static int __init gic_acpi_parse_virt_madt_gicc(union acpi_subtable_headers *hea
> * The maintenance interrupt and GICV should be the same for every CPU
> */
> if ((acpi_data.maint_irq != gicc->vgic_interrupt) ||
> - (acpi_data.maint_irq_mode != maint_irq_mode) ||
> (acpi_data.vcpu_base != gicc->gicv_base_address))
> return -EINVAL;
>
> @@ -2514,7 +2510,7 @@ static void __init gic_acpi_setup_kvm_info(void)
> gic_v3_kvm_info.type = GIC_V3;
>
> irq = acpi_register_gsi(NULL, acpi_data.maint_irq,
> - acpi_data.maint_irq_mode,
> + ACPI_LEVEL_SENSITIVE,
> ACPI_ACTIVE_HIGH);
> if (irq <= 0)
> return;
> diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
> index ec70c84e9f91d..74bda5e246345 100644
> --- a/drivers/irqchip/irq-gic.c
> +++ b/drivers/irqchip/irq-gic.c
> @@ -1527,7 +1527,6 @@ static struct
> {
> phys_addr_t cpu_phys_base;
> u32 maint_irq;
> - int maint_irq_mode;
> phys_addr_t vctrl_base;
> phys_addr_t vcpu_base;
> } acpi_data __initdata;
> @@ -1553,10 +1552,11 @@ gic_acpi_parse_madt_cpu(union acpi_subtable_headers *header,
> if (cpu_base_assigned && gic_cpu_base != acpi_data.cpu_phys_base)
> return -EINVAL;
>
> + if (processor->flags & ACPI_MADT_VGIC_IRQ_MODE)
> + pr_warn_once(FW_BUG "MI wrongly advertised as Edge-triggered\n");
> +
> acpi_data.cpu_phys_base = gic_cpu_base;
> acpi_data.maint_irq = processor->vgic_interrupt;
> - acpi_data.maint_irq_mode = (processor->flags & ACPI_MADT_VGIC_IRQ_MODE) ?
> - ACPI_EDGE_SENSITIVE : ACPI_LEVEL_SENSITIVE;
> acpi_data.vctrl_base = processor->gich_base_address;
> acpi_data.vcpu_base = processor->gicv_base_address;
>
> @@ -1616,7 +1616,7 @@ static void __init gic_acpi_setup_kvm_info(void)
> vcpu_res->end = vcpu_res->start + ACPI_GICV2_VCPU_MEM_SIZE - 1;
>
> irq = acpi_register_gsi(NULL, acpi_data.maint_irq,
> - acpi_data.maint_irq_mode,
> + ACPI_LEVEL_SENSITIVE,
> ACPI_ACTIVE_HIGH);
> if (irq <= 0)
> return;
Reviewed-by: Radu Rendec <radu at rendec.net>
More information about the linux-arm-kernel
mailing list