Commit 6eba09a4 authored by Jacob Pan's avatar Jacob Pan Committed by Joerg Roedel

iommu/vt-d: Reject SVM bind for failed capability check

Add a check during SVM bind to ensure CPU and IOMMU hardware capabilities
are met.
Signed-off-by: default avatarJacob Pan <jacob.jun.pan@linux.intel.com>
Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 79db7e1b
...@@ -234,6 +234,9 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_ ...@@ -234,6 +234,9 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_
if (!iommu || dmar_disabled) if (!iommu || dmar_disabled)
return -EINVAL; return -EINVAL;
if (!intel_svm_capable(iommu))
return -ENOTSUPP;
if (dev_is_pci(dev)) { if (dev_is_pci(dev)) {
pasid_max = pci_max_pasids(to_pci_dev(dev)); pasid_max = pci_max_pasids(to_pci_dev(dev));
if (pasid_max < 0) if (pasid_max < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment