diff --git a/hypervisor/acpi_parser/dmar_parse.c b/hypervisor/acpi_parser/dmar_parse.c index 968544ac4..b1c36f752 100644 --- a/hypervisor/acpi_parser/dmar_parse.c +++ b/hypervisor/acpi_parser/dmar_parse.c @@ -192,8 +192,9 @@ int32_t parse_dmar_table(struct dmar_info *plat_dmar_info) /* Only support single PCI Segment */ if (acpi_drhd->flags & DRHD_FLAG_INCLUDE_PCI_ALL_MASK) { - ASSERT(!is_include_all_emulated, - "DRHD with INCLUDE_PCI_ALL flag should be the last one"); + if (!is_include_all_emulated) { + pr_warn("DRHD with INCLUDE_PCI_ALL flag is NOT the last one!"); + } is_include_all_emulated = true; } diff --git a/hypervisor/hw/pci.c b/hypervisor/hw/pci.c index 7b009ecff..2096630b4 100644 --- a/hypervisor/hw/pci.c +++ b/hypervisor/hw/pci.c @@ -522,11 +522,11 @@ static void pci_parse_iommu_devscopes(struct pci_bdf_mapping_group *const bdfs_f */ } } - } - if ((plat_dmar_info.drhd_units[plat_dmar_info.drhd_count - 1U].flags & DRHD_FLAG_INCLUDE_PCI_ALL_MASK) - == DRHD_FLAG_INCLUDE_PCI_ALL_MASK) { - *drhd_idx_pci_all = plat_dmar_info.drhd_count - 1U; + if ((plat_dmar_info.drhd_units[drhd_index].flags & DRHD_FLAG_INCLUDE_PCI_ALL_MASK) + == DRHD_FLAG_INCLUDE_PCI_ALL_MASK) { + *drhd_idx_pci_all = drhd_index; + } } }