iommu/vt-d: Remove svm_dev_ops
ANBZ: #857 commit2e1a44c1c4
upstream. The svm_dev_ops has never been referenced in the tree, and there's no plan to have anything to use it. Remove it to make the code neat. Intel-SIG: commit2e1a44c1c4
iommu/vt-d: Remove svm_dev_ops. Incremental backporting patches for DSA/IAA on Intel Xeon platform. 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-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de> [ Xiaochen Shen: amend commit log ] Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com> Reviewed-by: Artie Ding <artie.ding@linux.alibaba.com>
This commit is contained in:
parent
d5de8a1972
commit
b3b4b5762e
|
@ -462,7 +462,6 @@ static void load_pasid(struct mm_struct *mm, u32 pasid)
|
||||||
/* Caller must hold pasid_mutex, mm reference */
|
/* Caller must hold pasid_mutex, mm reference */
|
||||||
static int
|
static int
|
||||||
intel_svm_bind_mm(struct device *dev, unsigned int flags,
|
intel_svm_bind_mm(struct device *dev, unsigned int flags,
|
||||||
struct svm_dev_ops *ops,
|
|
||||||
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);
|
||||||
|
@ -512,10 +511,6 @@ intel_svm_bind_mm(struct device *dev, unsigned int flags,
|
||||||
|
|
||||||
/* Find the matching device in svm list */
|
/* Find the matching device in svm list */
|
||||||
for_each_svm_dev(sdev, svm, dev) {
|
for_each_svm_dev(sdev, svm, dev) {
|
||||||
if (sdev->ops != ops) {
|
|
||||||
ret = -EBUSY;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
sdev->users++;
|
sdev->users++;
|
||||||
goto success;
|
goto success;
|
||||||
}
|
}
|
||||||
|
@ -550,7 +545,6 @@ intel_svm_bind_mm(struct device *dev, unsigned int flags,
|
||||||
|
|
||||||
/* Finish the setup now we know we're keeping it */
|
/* Finish the setup now we know we're keeping it */
|
||||||
sdev->users = 1;
|
sdev->users = 1;
|
||||||
sdev->ops = ops;
|
|
||||||
init_rcu_head(&sdev->rcu);
|
init_rcu_head(&sdev->rcu);
|
||||||
|
|
||||||
if (!svm) {
|
if (!svm) {
|
||||||
|
@ -1006,13 +1000,6 @@ invalid:
|
||||||
mmap_read_unlock(svm->mm);
|
mmap_read_unlock(svm->mm);
|
||||||
mmput(svm->mm);
|
mmput(svm->mm);
|
||||||
bad_req:
|
bad_req:
|
||||||
WARN_ON(!sdev);
|
|
||||||
if (sdev && sdev->ops && sdev->ops->fault_cb) {
|
|
||||||
int rwxp = (req->rd_req << 3) | (req->wr_req << 2) |
|
|
||||||
(req->exe_req << 1) | (req->pm_req);
|
|
||||||
sdev->ops->fault_cb(sdev->dev, req->pasid, req->addr,
|
|
||||||
req->priv_data, rwxp, result);
|
|
||||||
}
|
|
||||||
/* We get here in the error case where the PASID lookup failed,
|
/* We get here in the error case where the PASID lookup failed,
|
||||||
and these can be NULL. Do not use them below this point! */
|
and these can be NULL. Do not use them below this point! */
|
||||||
sdev = NULL;
|
sdev = NULL;
|
||||||
|
@ -1087,7 +1074,7 @@ intel_svm_bind(struct device *dev, struct mm_struct *mm, void *drvdata)
|
||||||
if (drvdata)
|
if (drvdata)
|
||||||
flags = *(unsigned int *)drvdata;
|
flags = *(unsigned int *)drvdata;
|
||||||
mutex_lock(&pasid_mutex);
|
mutex_lock(&pasid_mutex);
|
||||||
ret = intel_svm_bind_mm(dev, flags, NULL, mm, &sdev);
|
ret = intel_svm_bind_mm(dev, flags, mm, &sdev);
|
||||||
if (ret)
|
if (ret)
|
||||||
sva = ERR_PTR(ret);
|
sva = ERR_PTR(ret);
|
||||||
else if (sdev)
|
else if (sdev)
|
||||||
|
|
|
@ -755,14 +755,11 @@ u32 intel_svm_get_pasid(struct iommu_sva *handle);
|
||||||
int intel_svm_page_response(struct device *dev, struct iommu_fault_event *evt,
|
int intel_svm_page_response(struct device *dev, struct iommu_fault_event *evt,
|
||||||
struct iommu_page_response *msg);
|
struct iommu_page_response *msg);
|
||||||
|
|
||||||
struct svm_dev_ops;
|
|
||||||
|
|
||||||
struct intel_svm_dev {
|
struct intel_svm_dev {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
struct rcu_head rcu;
|
struct rcu_head rcu;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
struct intel_iommu *iommu;
|
struct intel_iommu *iommu;
|
||||||
struct svm_dev_ops *ops;
|
|
||||||
struct iommu_sva sva;
|
struct iommu_sva sva;
|
||||||
u32 pasid;
|
u32 pasid;
|
||||||
int users;
|
int users;
|
||||||
|
|
|
@ -8,13 +8,6 @@
|
||||||
#ifndef __INTEL_SVM_H__
|
#ifndef __INTEL_SVM_H__
|
||||||
#define __INTEL_SVM_H__
|
#define __INTEL_SVM_H__
|
||||||
|
|
||||||
struct device;
|
|
||||||
|
|
||||||
struct svm_dev_ops {
|
|
||||||
void (*fault_cb)(struct device *dev, u32 pasid, u64 address,
|
|
||||||
void *private, int rwxp, int response);
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Values for rxwp in fault_cb callback */
|
/* Values for rxwp in fault_cb callback */
|
||||||
#define SVM_REQ_READ (1<<3)
|
#define SVM_REQ_READ (1<<3)
|
||||||
#define SVM_REQ_WRITE (1<<2)
|
#define SVM_REQ_WRITE (1<<2)
|
||||||
|
|
Loading…
Reference in New Issue