diff options
author | Jacob Pan <jacob.jun.pan@linux.intel.com> | 2020-01-02 08:18:05 +0800 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2020-01-07 14:05:57 +0100 |
commit | 6eba09a4b5d583ad18a2a1fd1b82aee8cc3ac542 (patch) | |
tree | 4a755ad8d5114cfebda5a9e0c27a7105dcc063b4 /drivers | |
parent | 79db7e1b4cf2a006f556099c13de3b12970fc6e3 (diff) | |
download | linux-stable-6eba09a4b5d583ad18a2a1fd1b82aee8cc3ac542.tar.gz linux-stable-6eba09a4b5d583ad18a2a1fd1b82aee8cc3ac542.tar.bz2 linux-stable-6eba09a4b5d583ad18a2a1fd1b82aee8cc3ac542.zip |
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: Jacob Pan <jacob.jun.pan@linux.intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iommu/intel-svm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c index e4a5d542b84f..48205ab1fea4 100644 --- a/drivers/iommu/intel-svm.c +++ b/drivers/iommu/intel-svm.c @@ -234,6 +234,9 @@ int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_ if (!iommu || dmar_disabled) return -EINVAL; + if (!intel_svm_capable(iommu)) + return -ENOTSUPP; + if (dev_is_pci(dev)) { pasid_max = pci_max_pasids(to_pci_dev(dev)); if (pasid_max < 0) |