|
@@ -2488,6 +2488,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
|
|
|
PCMachineState *pcms = PC_MACHINE(machine);
|
|
|
PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
|
|
|
X86MachineState *x86ms = X86_MACHINE(machine);
|
|
|
+ X86IOMMUState *iommu = x86_iommu_get_default();
|
|
|
GArray *table_offsets;
|
|
|
unsigned facs, dsdt, rsdt, fadt;
|
|
|
AcpiPmInfo pm;
|
|
@@ -2604,17 +2605,14 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
|
|
|
build_mcfg(tables_blob, tables->linker, &mcfg, x86ms->oem_id,
|
|
|
x86ms->oem_table_id);
|
|
|
}
|
|
|
- if (x86_iommu_get_default()) {
|
|
|
- IommuType IOMMUType = x86_iommu_get_type();
|
|
|
- if (IOMMUType == TYPE_AMD) {
|
|
|
- acpi_add_table(table_offsets, tables_blob);
|
|
|
- build_amd_iommu(tables_blob, tables->linker, x86ms->oem_id,
|
|
|
- x86ms->oem_table_id);
|
|
|
- } else if (IOMMUType == TYPE_INTEL) {
|
|
|
- acpi_add_table(table_offsets, tables_blob);
|
|
|
- build_dmar_q35(tables_blob, tables->linker, x86ms->oem_id,
|
|
|
- x86ms->oem_table_id);
|
|
|
- }
|
|
|
+ if (object_dynamic_cast(OBJECT(iommu), TYPE_AMD_IOMMU_DEVICE)) {
|
|
|
+ acpi_add_table(table_offsets, tables_blob);
|
|
|
+ build_amd_iommu(tables_blob, tables->linker, x86ms->oem_id,
|
|
|
+ x86ms->oem_table_id);
|
|
|
+ } else if (object_dynamic_cast(OBJECT(iommu), TYPE_INTEL_IOMMU_DEVICE)) {
|
|
|
+ acpi_add_table(table_offsets, tables_blob);
|
|
|
+ build_dmar_q35(tables_blob, tables->linker, x86ms->oem_id,
|
|
|
+ x86ms->oem_table_id);
|
|
|
}
|
|
|
if (machine->nvdimms_state->is_enabled) {
|
|
|
nvdimm_build_acpi(table_offsets, tables_blob, tables->linker,
|