diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2015-10-15 12:59:14 (GMT) |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2015-10-15 14:35:32 (GMT) |
commit | 569e4f7782fb92d0e1b395b5fb01de642dd74dcf (patch) | |
tree | ef6aabacf8524f4adbcf7b0b9fbc0c2d3c2b282a /drivers/iommu | |
parent | 0204a49609824163092c32a8aeb073f7e9acc76d (diff) | |
download | linux-569e4f7782fb92d0e1b395b5fb01de642dd74dcf.tar.xz |
iommu/vt-d: Implement SVM_FLAG_PRIVATE_PASID to allocate unique PASIDs
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/intel-svm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c index 006e95d..89d4d47 100644 --- a/drivers/iommu/intel-svm.c +++ b/drivers/iommu/intel-svm.c @@ -285,11 +285,12 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_ pasid_max = 1 << 20; mutex_lock(&pasid_mutex); - if (pasid) { + if (pasid && !(flags & SVM_FLAG_PRIVATE_PASID)) { int i; idr_for_each_entry(&iommu->pasid_idr, svm, i) { - if (svm->mm != current->mm) + if (svm->mm != current->mm || + (svm->flags & SVM_FLAG_PRIVATE_PASID)) continue; if (svm->pasid >= pasid_max) { @@ -355,6 +356,7 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_ svm->pasid = ret; svm->notifier.ops = &intel_mmuops; svm->mm = get_task_mm(current); + svm->flags = flags; INIT_LIST_HEAD_RCU(&svm->devs); ret = -ENOMEM; if (!svm->mm || (ret = mmu_notifier_register(&svm->notifier, svm->mm))) { |