hv: Change to a permissive check with broken DMAR table

From the VT-d spec 8.3:
If a DRHD structure with INCLUDE_PCI_ALL flag Set is reported for a
Segment, it must be enumerated by BIOS after all other DRHD structures
for the same Segment.

However, some broken BIOS violate the rules. To bring up ACRN with them,
change the ASSERT to a permissive check to unblock the BIOS limitation.
Also, scan the DRHD list to find the one who has INCLUDE_PCI_ALL flag.

Tracked-On: #4937
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
This commit is contained in:
Shuo A Liu 2020-06-12 09:40:48 +08:00 committed by wenlingz
parent 03e18ec492
commit 2276f1c43d
2 changed files with 7 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;
}
}
}