mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
iommu/vt-d: Remove SVM_FLAG_PRIVATE_PASID
The SVM_FLAG_PRIVATE_PASID has never been referenced in the tree, and there's no plan to have anything to use it. So cleanup it. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20210323010600.678627-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
parent
2e1a44c1c4
commit
06905ea831
2 changed files with 22 additions and 36 deletions
|
@ -465,9 +465,9 @@ intel_svm_bind_mm(struct device *dev, unsigned int flags,
|
||||||
struct mm_struct *mm, struct intel_svm_dev **sd)
|
struct mm_struct *mm, struct intel_svm_dev **sd)
|
||||||
{
|
{
|
||||||
struct intel_iommu *iommu = device_to_iommu(dev, NULL, NULL);
|
struct intel_iommu *iommu = device_to_iommu(dev, NULL, NULL);
|
||||||
|
struct intel_svm *svm = NULL, *t;
|
||||||
struct device_domain_info *info;
|
struct device_domain_info *info;
|
||||||
struct intel_svm_dev *sdev;
|
struct intel_svm_dev *sdev;
|
||||||
struct intel_svm *svm = NULL;
|
|
||||||
unsigned long iflags;
|
unsigned long iflags;
|
||||||
int pasid_max;
|
int pasid_max;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -493,30 +493,26 @@ intel_svm_bind_mm(struct device *dev, unsigned int flags,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags & SVM_FLAG_PRIVATE_PASID)) {
|
list_for_each_entry(t, &global_svm_list, list) {
|
||||||
struct intel_svm *t;
|
if (t->mm != mm)
|
||||||
|
continue;
|
||||||
|
|
||||||
list_for_each_entry(t, &global_svm_list, list) {
|
svm = t;
|
||||||
if (t->mm != mm || (t->flags & SVM_FLAG_PRIVATE_PASID))
|
if (svm->pasid >= pasid_max) {
|
||||||
continue;
|
dev_warn(dev,
|
||||||
|
"Limited PASID width. Cannot use existing PASID %d\n",
|
||||||
svm = t;
|
svm->pasid);
|
||||||
if (svm->pasid >= pasid_max) {
|
ret = -ENOSPC;
|
||||||
dev_warn(dev,
|
goto out;
|
||||||
"Limited PASID width. Cannot use existing PASID %d\n",
|
|
||||||
svm->pasid);
|
|
||||||
ret = -ENOSPC;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Find the matching device in svm list */
|
|
||||||
for_each_svm_dev(sdev, svm, dev) {
|
|
||||||
sdev->users++;
|
|
||||||
goto success;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Find the matching device in svm list */
|
||||||
|
for_each_svm_dev(sdev, svm, dev) {
|
||||||
|
sdev->users++;
|
||||||
|
goto success;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sdev = kzalloc(sizeof(*sdev), GFP_KERNEL);
|
sdev = kzalloc(sizeof(*sdev), GFP_KERNEL);
|
||||||
|
|
|
@ -14,16 +14,6 @@
|
||||||
#define SVM_REQ_EXEC (1<<1)
|
#define SVM_REQ_EXEC (1<<1)
|
||||||
#define SVM_REQ_PRIV (1<<0)
|
#define SVM_REQ_PRIV (1<<0)
|
||||||
|
|
||||||
/*
|
|
||||||
* The SVM_FLAG_PRIVATE_PASID flag requests a PASID which is *not* the "main"
|
|
||||||
* PASID for the current process. Even if a PASID already exists, a new one
|
|
||||||
* will be allocated. And the PASID allocated with SVM_FLAG_PRIVATE_PASID
|
|
||||||
* will not be given to subsequent callers. This facility allows a driver to
|
|
||||||
* disambiguate between multiple device contexts which access the same MM,
|
|
||||||
* if there is no other way to do so. It should be used sparingly, if at all.
|
|
||||||
*/
|
|
||||||
#define SVM_FLAG_PRIVATE_PASID (1<<0)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The SVM_FLAG_SUPERVISOR_MODE flag requests a PASID which can be used only
|
* The SVM_FLAG_SUPERVISOR_MODE flag requests a PASID which can be used only
|
||||||
* for access to kernel addresses. No IOTLB flushes are automatically done
|
* for access to kernel addresses. No IOTLB flushes are automatically done
|
||||||
|
@ -35,18 +25,18 @@
|
||||||
* It is unlikely that we will ever hook into flush_tlb_kernel_range() to
|
* It is unlikely that we will ever hook into flush_tlb_kernel_range() to
|
||||||
* do such IOTLB flushes automatically.
|
* do such IOTLB flushes automatically.
|
||||||
*/
|
*/
|
||||||
#define SVM_FLAG_SUPERVISOR_MODE (1<<1)
|
#define SVM_FLAG_SUPERVISOR_MODE BIT(0)
|
||||||
/*
|
/*
|
||||||
* The SVM_FLAG_GUEST_MODE flag is used when a PASID bind is for guest
|
* The SVM_FLAG_GUEST_MODE flag is used when a PASID bind is for guest
|
||||||
* processes. Compared to the host bind, the primary differences are:
|
* processes. Compared to the host bind, the primary differences are:
|
||||||
* 1. mm life cycle management
|
* 1. mm life cycle management
|
||||||
* 2. fault reporting
|
* 2. fault reporting
|
||||||
*/
|
*/
|
||||||
#define SVM_FLAG_GUEST_MODE (1<<2)
|
#define SVM_FLAG_GUEST_MODE BIT(1)
|
||||||
/*
|
/*
|
||||||
* The SVM_FLAG_GUEST_PASID flag is used when a guest has its own PASID space,
|
* The SVM_FLAG_GUEST_PASID flag is used when a guest has its own PASID space,
|
||||||
* which requires guest and host PASID translation at both directions.
|
* which requires guest and host PASID translation at both directions.
|
||||||
*/
|
*/
|
||||||
#define SVM_FLAG_GUEST_PASID (1<<3)
|
#define SVM_FLAG_GUEST_PASID BIT(2)
|
||||||
|
|
||||||
#endif /* __INTEL_SVM_H__ */
|
#endif /* __INTEL_SVM_H__ */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue