xen/amd/iommu: Skip IO-APICs missing from the IVRS in shared IRT mode
PATCH 1/1 xen/amd/iommu: Skip IO-APICs missing from the IVRS in shared IRT mode
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.
--- xen/drivers/passthrough/amd/iommu_acpi.c | 1 + 1 file changed, 1 insertion(+)
xen/drivers/passthrough/amd/iommu_acpi.c +1 -0
@@ -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. */
Signature · 1 line
2.43.0
Le 21/10/2026 à 00:02, Stefano Stabellini a écrit :
Quoted 20 lines
When an IO-APIC with entries isn't described by the IVRS,
ioapic_id_to_index()returnsMAX_IO_APICS. With per-device interrupt remapping tables this is fatal, but in shared modeparse_ivrs_table()only logs it and then usesMAX_IO_APICSas 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 <[email protected]>--- xen/drivers/passthrough/amd/iommu_acpi.c | 1 + 1 file changed, 1 insertion(+)xen/drivers/passthrough/amd/iommu_acpi.c +0
-0
xen/drivers/passthrough/amd/iommu_acpi.c static int __init cf_check parse_ivrs_table(struct acpi_table_header *table) · line 1138
Quoted 7 lines
xen/drivers/passthrough/amd/iommu_acpi.c +1
-0@@ -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. */
Teddy
Jan Beulich
Acked-byQuoted 7 lines · Teddy Astie
Le 21/10/2026 à 00:02, Stefano Stabellini a écrit :
Quoted 6 lines
When an IO-APIC with entries isn't described by the IVRS,
ioapic_id_to_index()returnsMAX_IO_APICS. With per-device interrupt remapping tables this is fatal, but in shared modeparse_ivrs_table()only logs it and then usesMAX_IO_APICSas an index, reading and writing one past the end of ioapic_sbdf[].
Quoted 7 lines
Quoted 5 lines
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 <[email protected]>Reviewed-by Teddy Astie <[email protected]>