xen/drivers/passthrough/amd/iommu_acpi.c | 1 + 1 file changed, 1 insertion(+)
When an IO-APIC with entries isn't described by the IVRS,
ioapic_id_to_index() returns MAX_IO_APICS. With per-device interrupt
remapping tables this is fatal, but in shared mode parse_ivrs_table()
only logs it and then uses MAX_IO_APICS as an index, reading and writing
one past the end of ioapic_sbdf[].
Skip such an IO-APIC instead. It is left without interrupt remapping,
which is what the rest of the code already assumes for an IO-APIC with
no index.
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
xen/drivers/passthrough/amd/iommu_acpi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthrough/amd/iommu_acpi.c
index 39ae637959..4688908824 100644
--- a/xen/drivers/passthrough/amd/iommu_acpi.c
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c
@@ -1132,6 +1132,7 @@ static int __init cf_check parse_ivrs_table(struct acpi_table_header *table)
IO_APIC_ID(apic));
if ( amd_iommu_perdev_intremap )
return -ENXIO;
+ continue;
}
/* SB IO-APIC is always on this device in AMD systems. */
--
2.43.0
Le 21/10/2026 à 00:02, Stefano Stabellini a écrit : > When an IO-APIC with entries isn't described by the IVRS, > ioapic_id_to_index() returns MAX_IO_APICS. With per-device interrupt > remapping tables this is fatal, but in shared mode parse_ivrs_table() > only logs it and then uses MAX_IO_APICS as an index, reading and writing > one past the end of ioapic_sbdf[]. > > Skip such an IO-APIC instead. It is left without interrupt remapping, > which is what the rest of the code already assumes for an IO-APIC with > no index. > > Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com> > --- > xen/drivers/passthrough/amd/iommu_acpi.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthrough/amd/iommu_acpi.c > index 39ae637959..4688908824 100644 > --- a/xen/drivers/passthrough/amd/iommu_acpi.c > +++ b/xen/drivers/passthrough/amd/iommu_acpi.c > @@ -1132,6 +1132,7 @@ static int __init cf_check parse_ivrs_table(struct acpi_table_header *table) > IO_APIC_ID(apic)); > if ( amd_iommu_perdev_intremap ) > return -ENXIO; > + continue; > } > > /* SB IO-APIC is always on this device in AMD systems. */ Reviewed-by: Teddy Astie <teddy.astie@vates.tech> Teddy
On 21.10.2026 10:51, Teddy Astie wrote: > Le 21/10/2026 à 00:02, Stefano Stabellini a écrit : >> When an IO-APIC with entries isn't described by the IVRS, >> ioapic_id_to_index() returns MAX_IO_APICS. With per-device interrupt >> remapping tables this is fatal, but in shared mode parse_ivrs_table() >> only logs it and then uses MAX_IO_APICS as an index, reading and writing >> one past the end of ioapic_sbdf[]. >> >> Skip such an IO-APIC instead. It is left without interrupt remapping, >> which is what the rest of the code already assumes for an IO-APIC with >> no index. >> >> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com> > > Reviewed-by: Teddy Astie <teddy.astie@vates.tech> Acked-by: Jan Beulich <jbeulich@suse.com>
© 2016 - 2026 Red Hat, Inc.