Skip to content

Commit 544808f

Browse files
Andre-ARMMarc Zyngier
authored andcommitted
irqchip/gic, gic-v3: Prevent GSI to SGI translations
At the moment the GIC IRQ domain translation routine happily converts ACPI table GSI numbers below 16 to GIC SGIs (Software Generated Interrupts aka IPIs). On the Devicetree side we explicitly forbid this translation, actually the function will never return HWIRQs below 16 when using a DT based domain translation. We expect SGIs to be handled in the first part of the function, and any further occurrence should be treated as a firmware bug, so add a check and print to report this explicitly and avoid lengthy debug sessions. Fixes: 64b499d ("irqchip/gic-v3: Configure SGIs as standard interrupts") Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220404110842.2882446-1-andre.przywara@arm.com
1 parent 0df6664 commit 544808f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/irqchip/irq-gic-v3.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,6 +1466,12 @@ static int gic_irq_domain_translate(struct irq_domain *d,
14661466
if(fwspec->param_count != 2)
14671467
return -EINVAL;
14681468

1469+
if (fwspec->param[0] < 16) {
1470+
pr_err(FW_BUG "Illegal GSI%d translation request\n",
1471+
fwspec->param[0]);
1472+
return -EINVAL;
1473+
}
1474+
14691475
*hwirq = fwspec->param[0];
14701476
*type = fwspec->param[1];
14711477

drivers/irqchip/irq-gic.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,12 @@ static int gic_irq_domain_translate(struct irq_domain *d,
11231123
if(fwspec->param_count != 2)
11241124
return -EINVAL;
11251125

1126+
if (fwspec->param[0] < 16) {
1127+
pr_err(FW_BUG "Illegal GSI%d translation request\n",
1128+
fwspec->param[0]);
1129+
return -EINVAL;
1130+
}
1131+
11261132
*hwirq = fwspec->param[0];
11271133
*type = fwspec->param[1];
11281134

0 commit comments

Comments
 (0)