Commit 48739afa authored by Lu Baolu's avatar Lu Baolu Committed by Joerg Roedel

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: default avatarLiu Yi L <yi.l.liu@intel.com>
Fixes: 6f7db75e ("iommu/vt-d: Add second level page table interface")
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent c56cba5d
...@@ -466,8 +466,8 @@ void intel_pasid_tear_down_entry(struct intel_iommu *iommu, ...@@ -466,8 +466,8 @@ void intel_pasid_tear_down_entry(struct intel_iommu *iommu,
if (WARN_ON(!pte)) if (WARN_ON(!pte))
return; return;
intel_pasid_clear_entry(dev, pasid);
did = pasid_get_domain_id(pte); did = pasid_get_domain_id(pte);
intel_pasid_clear_entry(dev, pasid);
if (!ecap_coherent(iommu->ecap)) if (!ecap_coherent(iommu->ecap))
clflush_cache_range(pte, sizeof(*pte)); clflush_cache_range(pte, sizeof(*pte));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment