]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
iommu/vt-d: do not assume page table levels for quarantine domain
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 19 Dec 2023 12:48:09 +0000 (13:48 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 19 Dec 2023 12:48:09 +0000 (13:48 +0100)
Like XSA-445, do not assume IOMMU page table levels on VT-d are always set
based on DEFAULT_DOMAIN_ADDRESS_WIDTH and instead fetch the value set by
intel_iommu_domain_init() from the domain iommu structure.  This prevents
changes to intel_iommu_domain_init() possibly getting the levels out of sync
with what intel_iommu_quarantine_init() expects.

No functional change, since on Intel domains are hardcoded to use
DEFAULT_DOMAIN_ADDRESS_WIDTH.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/vtd/iommu.c

index e13b7d99db4024c63e48e623281315a2e407c11a..bc6181c9f91117b767dbc8cd9f97a8b0bdbd1144 100644 (file)
@@ -3162,7 +3162,7 @@ static int cf_check intel_iommu_quarantine_init(struct pci_dev *pdev,
 {
     struct domain_iommu *hd = dom_iommu(dom_io);
     struct page_info *pg;
-    unsigned int agaw = width_to_agaw(DEFAULT_DOMAIN_ADDRESS_WIDTH);
+    unsigned int agaw = hd->arch.vtd.agaw;
     unsigned int level = agaw_to_level(agaw);
     const struct acpi_drhd_unit *drhd;
     const struct acpi_rmrr_unit *rmrr;