[PATCH v2 00/12] iommu: Remove IOMMU_DEV_FEAT_SVA/_IOPF

Lu Baolu posted 12 patches 9 months, 3 weeks ago
There is a newer version of this series
drivers/accel/amdxdna/aie2_pci.c              |  13 +-
drivers/dma/idxd/init.c                       |  43 +--
drivers/iommu/amd/iommu.c                     |  34 --
.../iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c   |  86 +----
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c   | 137 ++++----
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h   |  39 +--
drivers/iommu/intel/iommu.c                   | 301 ++++++------------
drivers/iommu/intel/iommu.h                   |  50 ++-
drivers/iommu/intel/nested.c                  |  16 +-
drivers/iommu/intel/pasid.c                   |  41 +--
drivers/iommu/intel/prq.c                     |   2 +-
drivers/iommu/intel/svm.c                     |  52 ++-
drivers/iommu/iommu-sva.c                     |   3 -
drivers/iommu/iommu.c                         |  32 --
drivers/iommu/iommufd/device.c                |   1 -
drivers/iommu/iommufd/fault.c                 | 111 ++-----
drivers/iommu/iommufd/iommufd_private.h       |   3 -
drivers/iommu/iommufd/selftest.c              |  63 +++-
drivers/misc/uacce/uacce.c                    |  40 ---
include/linux/iommu.h                         |  35 --
20 files changed, 401 insertions(+), 701 deletions(-)
[PATCH v2 00/12] iommu: Remove IOMMU_DEV_FEAT_SVA/_IOPF
Posted by Lu Baolu 9 months, 3 weeks ago
The new method for driver fault reporting support relies on the domain
to specify a iopf_handler. The driver should detect this and setup the
HW when fault capable domains are attached.

Move SMMUv3 to use this method and have VT-D validate support during
attach so that all three fault capable drivers have a no-op FEAT_SVA and
_IOPF. Then remove them.

This was initiated by Jason. I'm following up to remove FEAT_IOPF and
further clean up.

The whole series is also available at github:
https://github.com/LuBaolu/intel-iommu/commits/iommu_no_feat-v2

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>

Change log:
v2:
 - Fix removing wrong nesting master_domain in
   arm_smmu_remove_master_domain().
 - Fix iopf enable/disable in iommufd mock driver for domain
   replacement. 

v1: https://lore.kernel.org/linux-iommu/20250214061104.1959525-1-baolu.lu@linux.intel.com/

Jason Gunthorpe (3):
  iommu/arm-smmu-v3: Put iopf enablement in the domain attach path
  iommu/vt-d: Check if SVA is supported when attaching the SVA domain
  iommu: Remove IOMMU_DEV_FEAT_SVA

Lu Baolu (9):
  iommu/vt-d: Move scalable mode ATS enablement to probe path
  iommu/vt-d: Move PRI enablement in probe path
  iommu/vt-d: Cleanup intel_context_flush_present()
  iommu/vt-d: Put iopf enablement in domain attach path
  iommufd/selftest: Put iopf enablement in domain attach path
  dmaengine: idxd: Remove unnecessary IOMMU_DEV_FEAT_IOPF
  uacce: Remove unnecessary IOMMU_DEV_FEAT_IOPF
  iommufd: Remove unnecessary IOMMU_DEV_FEAT_IOPF
  iommu: Remove iommu_dev_enable/disable_feature()

 drivers/accel/amdxdna/aie2_pci.c              |  13 +-
 drivers/dma/idxd/init.c                       |  43 +--
 drivers/iommu/amd/iommu.c                     |  34 --
 .../iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c   |  86 +----
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c   | 137 ++++----
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h   |  39 +--
 drivers/iommu/intel/iommu.c                   | 301 ++++++------------
 drivers/iommu/intel/iommu.h                   |  50 ++-
 drivers/iommu/intel/nested.c                  |  16 +-
 drivers/iommu/intel/pasid.c                   |  41 +--
 drivers/iommu/intel/prq.c                     |   2 +-
 drivers/iommu/intel/svm.c                     |  52 ++-
 drivers/iommu/iommu-sva.c                     |   3 -
 drivers/iommu/iommu.c                         |  32 --
 drivers/iommu/iommufd/device.c                |   1 -
 drivers/iommu/iommufd/fault.c                 | 111 ++-----
 drivers/iommu/iommufd/iommufd_private.h       |   3 -
 drivers/iommu/iommufd/selftest.c              |  63 +++-
 drivers/misc/uacce/uacce.c                    |  40 ---
 include/linux/iommu.h                         |  35 --
 20 files changed, 401 insertions(+), 701 deletions(-)

-- 
2.43.0
Re: [PATCH v2 00/12] iommu: Remove IOMMU_DEV_FEAT_SVA/_IOPF
Posted by Zhangfei Gao 9 months, 3 weeks ago
On Mon, 24 Feb 2025 at 13:16, Lu Baolu <baolu.lu@linux.intel.com> wrote:
>
> The new method for driver fault reporting support relies on the domain
> to specify a iopf_handler. The driver should detect this and setup the
> HW when fault capable domains are attached.
>
> Move SMMUv3 to use this method and have VT-D validate support during
> attach so that all three fault capable drivers have a no-op FEAT_SVA and
> _IOPF. Then remove them.
>
> This was initiated by Jason. I'm following up to remove FEAT_IOPF and
> further clean up.
>
> The whole series is also available at github:
> https://github.com/LuBaolu/intel-iommu/commits/iommu_no_feat-v2
>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
>
Thanks Baolu

Tested-by: Zhangfei Gao <zhangfei.gao@linaro.org>