Skip to content

Commit

Permalink
iommu/vt-d: Disable SVM when ATS/PRI/PASID are not enabled in the device
Browse files Browse the repository at this point in the history
Currently, the Intel VT-d supports Shared Virtual Memory (SVM) only when
IO page fault is supported. Otherwise, shared memory pages can not be
swapped out and need to be pinned. The device needs the Address Translation
Service (ATS), Page Request Interface (PRI) and Process Address Space
Identifier (PASID) capabilities to be enabled to support IO page fault.

Disable SVM when ATS, PRI and PASID are not enabled in the device.

Signed-off-by: Kyung Min Park <kyung.min.park@intel.com>
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20210314201534.918-1-kyung.min.park@intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Kyung Min Park authored and Joerg Roedel committed Mar 18, 2021
1 parent 1e28eed commit dec991e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/iommu/intel/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5380,6 +5380,9 @@ intel_iommu_dev_enable_feat(struct device *dev, enum iommu_dev_features feat)
if (!info)
return -EINVAL;

if (!info->pasid_enabled || !info->pri_enabled || !info->ats_enabled)
return -EINVAL;

if (info->iommu->flags & VTD_FLAG_SVM_CAPABLE)
return 0;
}
Expand Down

0 comments on commit dec991e

Please sign in to comment.