diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2015-10-13 15:11:13 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2015-10-15 14:22:35 +0200 |
commit | 907fea3491d52063bb37b1f1ce0cf8a4ae70944c (patch) | |
tree | 87bd60e81510676710fd1cedeb678c42e8d9704b /drivers/iommu/intel-svm.c | |
parent | iommu/vt-d: Add basic SVM PASID support (diff) | |
download | linux-907fea3491d52063bb37b1f1ce0cf8a4ae70944c.tar.xz linux-907fea3491d52063bb37b1f1ce0cf8a4ae70944c.zip |
iommu/vt-d: Implement deferred invalidate for SVM
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/iommu/intel-svm.c')
-rw-r--r-- | drivers/iommu/intel-svm.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c index 82d53e15b865..a64720b5bd34 100644 --- a/drivers/iommu/intel-svm.c +++ b/drivers/iommu/intel-svm.c @@ -26,6 +26,10 @@ struct pasid_entry { u64 val; }; +struct pasid_state_entry { + u64 val; +}; + int intel_svm_alloc_pasid_tables(struct intel_iommu *iommu) { struct page *pages; @@ -127,6 +131,11 @@ static void intel_flush_svm_range(struct intel_svm *svm, unsigned long address, { struct intel_svm_dev *sdev; + /* Try deferred invalidate if available */ + if (svm->iommu->pasid_state_table && + !cmpxchg64(&svm->iommu->pasid_state_table[svm->pasid].val, 0, 1ULL << 63)) + return; + rcu_read_lock(); list_for_each_entry_rcu(sdev, &svm->devs, list) intel_flush_svm_range_dev(svm, sdev, address, pages, ih); |