[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] VT-d: conditionalize IOTLB register offset check



commit 5449ba84e99849ee2339fd79f9717e10113d702d
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Nov 24 11:12:44 2021 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Nov 24 11:12:44 2021 +0100

    VT-d: conditionalize IOTLB register offset check
    
    As of commit 6773b1a7584a ("VT-d: Don't assume register-based
    invalidation is always supported") we don't (try to) use register based
    invalidation anymore when that's not supported by hardware. Hence
    there's also no point in the respective check, avoiding pointless IOMMU
    initialization failure. After all the spec (version 3.3 at the time of
    writing) doesn't say what the respective Extended Capability Register
    field would contain in such a case.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/drivers/passthrough/vtd/iommu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c 
b/xen/drivers/passthrough/vtd/iommu.c
index c1bf48cbcb..b33697e36b 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1274,7 +1274,8 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
 
     if ( cap_fault_reg_offset(iommu->cap) +
          cap_num_fault_regs(iommu->cap) * PRIMARY_FAULT_REG_LEN > PAGE_SIZE ||
-         ecap_iotlb_offset(iommu->ecap) >= PAGE_SIZE )
+         (has_register_based_invalidation(iommu) &&
+          ecap_iotlb_offset(iommu->ecap) >= PAGE_SIZE) )
     {
         printk(XENLOG_ERR VTDPREFIX "IOMMU: unsupported\n");
         print_iommu_regs(drhd);
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.