iommu/vt-d: Move iopf code from SVA to IOPF enabling path
authorLu Baolu <baolu.lu@linux.intel.com>
Thu, 13 Apr 2023 04:06:31 +0000 (12:06 +0800)
committerJoerg Roedel <jroedel@suse.de>
Thu, 13 Apr 2023 10:05:47 +0000 (12:05 +0200)
commit3d4c7cc3d168dc728dd3472688b2360b6db124e3
tree93c90348dc8edc1f617e149114b488a3b2015b2a
parenta86fb7717320bf2c05701cbcfaab5afc452d1480
iommu/vt-d: Move iopf code from SVA to IOPF enabling path

Generally enabling IOMMU_DEV_FEAT_SVA requires IOMMU_DEV_FEAT_IOPF, but
some devices manage I/O Page Faults themselves instead of relying on the
IOMMU. Move IOPF related code from SVA to IOPF enabling path.

For the device drivers that relies on the IOMMU for IOPF through PCI/PRI,
IOMMU_DEV_FEAT_IOPF must be enabled before and disabled after
IOMMU_DEV_FEAT_SVA.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20230324120234.313643-4-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c