Source
227
227
228
228
int intel_svm_bind_mm(struct device *dev, int *pasid, int flags, struct svm_dev_ops *ops)
229
229
{
230
230
struct intel_iommu *iommu = intel_svm_device_to_iommu(dev);
231
231
struct intel_svm_dev *sdev;
232
232
struct intel_svm *svm = NULL;
233
233
struct mm_struct *mm = NULL;
234
234
int pasid_max;
235
235
int ret;
236
236
237
-
if (!iommu)
237
+
if (!iommu || dmar_disabled)
238
238
return -EINVAL;
239
239
240
240
if (dev_is_pci(dev)) {
241
241
pasid_max = pci_max_pasids(to_pci_dev(dev));
242
242
if (pasid_max < 0)
243
243
return -EINVAL;
244
244
} else
245
245
pasid_max = 1 << 20;
246
246
247
247
if (flags & SVM_FLAG_SUPERVISOR_MODE) {