提交 eea4e29a 编写于 作者: L Liu Yi L 提交者: Joerg Roedel

iommu/vt-d: Fix sid not set issue in intel_svm_bind_gpasid()

Should get correct sid and set it into sdev. Because we execute
'sdev->sid != req->rid' in the loop of prq_event_thread().

Fixes: eb8d93ea ("iommu/vt-d: Report page request faults for guest SVA")
Signed-off-by: NLiu Yi L <yi.l.liu@intel.com>
Signed-off-by: NYi Sun <yi.y.sun@linux.intel.com>
Acked-by: NLu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/1604025444-6954-2-git-send-email-yi.y.sun@linux.intel.comSigned-off-by: NJoerg Roedel <jroedel@suse.de>
上级 6097df45
...@@ -279,6 +279,7 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev, ...@@ -279,6 +279,7 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev,
struct intel_iommu *iommu = device_to_iommu(dev, NULL, NULL); struct intel_iommu *iommu = device_to_iommu(dev, NULL, NULL);
struct intel_svm_dev *sdev = NULL; struct intel_svm_dev *sdev = NULL;
struct dmar_domain *dmar_domain; struct dmar_domain *dmar_domain;
struct device_domain_info *info;
struct intel_svm *svm = NULL; struct intel_svm *svm = NULL;
int ret = 0; int ret = 0;
...@@ -310,6 +311,10 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev, ...@@ -310,6 +311,10 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev,
if (data->hpasid <= 0 || data->hpasid >= PASID_MAX) if (data->hpasid <= 0 || data->hpasid >= PASID_MAX)
return -EINVAL; return -EINVAL;
info = get_domain_info(dev);
if (!info)
return -EINVAL;
dmar_domain = to_dmar_domain(domain); dmar_domain = to_dmar_domain(domain);
mutex_lock(&pasid_mutex); mutex_lock(&pasid_mutex);
...@@ -357,6 +362,7 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev, ...@@ -357,6 +362,7 @@ int intel_svm_bind_gpasid(struct iommu_domain *domain, struct device *dev,
goto out; goto out;
} }
sdev->dev = dev; sdev->dev = dev;
sdev->sid = PCI_DEVID(info->bus, info->devfn);
/* Only count users if device has aux domains */ /* Only count users if device has aux domains */
if (iommu_dev_feature_enabled(dev, IOMMU_DEV_FEAT_AUX)) if (iommu_dev_feature_enabled(dev, IOMMU_DEV_FEAT_AUX))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部