aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2019-02-28 22:23:13 -0500
committerJoerg Roedel <jroedel@suse.de>2019-03-01 04:23:36 -0500
commit48739afaac2a5a71a132cd43fd6bd5722680a9b1 (patch)
treec4215556cfd019d94ea97549b34f4512b951c4b2 /drivers
parentc56cba5daf45d2d091ef1cfe2f1d6a930446687b (diff)
iommu/vt-d: Get domain ID before clear pasid entry
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 <ashok.raj@intel.com> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> Signed-off-by: Liu Yi L <yi.l.liu@intel.com> Fixes: 6f7db75e1c469 ("iommu/vt-d: Add second level page table interface") Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iommu/intel-pasid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/intel-pasid.c b/drivers/iommu/intel-pasid.c
index 53fe5248d8f1..03b12d2ee213 100644
--- a/drivers/iommu/intel-pasid.c
+++ b/drivers/iommu/intel-pasid.c
@@ -466,8 +466,8 @@ void intel_pasid_tear_down_entry(struct intel_iommu *iommu,
466 if (WARN_ON(!pte)) 466 if (WARN_ON(!pte))
467 return; 467 return;
468 468
469 intel_pasid_clear_entry(dev, pasid);
470 did = pasid_get_domain_id(pte); 469 did = pasid_get_domain_id(pte);
470 intel_pasid_clear_entry(dev, pasid);
471 471
472 if (!ecap_coherent(iommu->ecap)) 472 if (!ecap_coherent(iommu->ecap))
473 clflush_cache_range(pte, sizeof(*pte)); 473 clflush_cache_range(pte, sizeof(*pte));