iommu/vt-d: Get domain ID before clear pasid entry
authorLu Baolu <[email protected]>
Fri, 1 Mar 2019 03:23:13 +0000 (11:23 +0800)
committerJoerg Roedel <[email protected]>
Fri, 1 Mar 2019 09:23:36 +0000 (10:23 +0100)
After tearing down a pasid entry, the domain id is used to
invalidate the translation caches. Retrieve the domain id
from the pasid entry value before clearing the pasid entry.
Otherwise, we will always use domain id 0.

Cc: Ashok Raj <[email protected]>
Cc: Jacob Pan <[email protected]>
Signed-off-by: Liu Yi L <[email protected]>
Fixes: 6f7db75e1c469 ("iommu/vt-d: Add second level page table interface")
Signed-off-by: Lu Baolu <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
drivers/iommu/intel-pasid.c

index 53fe5248d8f1c14424e7718c74580d84075fcfd0..03b12d2ee2132fe624eeed719dc486d89279f2e4 100644 (file)
@@ -466,8 +466,8 @@ void intel_pasid_tear_down_entry(struct intel_iommu *iommu,
        if (WARN_ON(!pte))
                return;
 
-       intel_pasid_clear_entry(dev, pasid);
        did = pasid_get_domain_id(pte);
+       intel_pasid_clear_entry(dev, pasid);
 
        if (!ecap_coherent(iommu->ecap))
                clflush_cache_range(pte, sizeof(*pte));