[PATCH v1 0/2] iommufd: Allocate attach_handle for any HWPT

Nicolin Chen posted 2 patches 10 months, 1 week ago
drivers/iommu/iommufd/iommufd_private.h |  41 +-------
drivers/iommu/iommufd/device.c          | 101 +++++++++++++++++++
drivers/iommu/iommufd/fault.c           | 128 +-----------------------
3 files changed, 109 insertions(+), 161 deletions(-)
[PATCH v1 0/2] iommufd: Allocate attach_handle for any HWPT
Posted by Nicolin Chen 10 months, 1 week ago
An attach_handle is a hwpt->fault specific thing, so the fault.c has been
holding a set of attach/detach/replace helpers for attach_handle and iopf
enabling/disabling.

Now, both the iommufd_msi series [1] and the attach_pasid series [2] want
to reuse the attach_handle for non-fault cases. Rework the attach_handle,
to prepare for either of the series. It should be merged with either that
gets merged first.

[1] https://lore.kernel.org/linux-iommu/cover.1736550979.git.nicolinc@nvidia.com/
[2] https://lore.kernel.org/linux-iommu/20241219132746.16193-1-yi.l.liu@intel.com/

Patches in this series are from [1] with some fixes addressing the review
comments.

Changelog
v1 (since [1])
 * Rebase on v6.14-rc1
 * Unwrap the fault attach/detach/replace helpers
 * Split the attach_handle patch to make it clearer

Thanks
Nicolin

Nicolin Chen (2):
  iommufd: Make attach_handle generic than fault specific
  iommufd/fault: Remove iommufd_fault_domain_attach/detach/replace_dev()

 drivers/iommu/iommufd/iommufd_private.h |  41 +-------
 drivers/iommu/iommufd/device.c          | 101 +++++++++++++++++++
 drivers/iommu/iommufd/fault.c           | 128 +-----------------------
 3 files changed, 109 insertions(+), 161 deletions(-)

-- 
2.43.0
Re: [PATCH v1 0/2] iommufd: Allocate attach_handle for any HWPT
Posted by Jason Gunthorpe 10 months ago
On Mon, Feb 03, 2025 at 09:00:53PM -0800, Nicolin Chen wrote:
> An attach_handle is a hwpt->fault specific thing, so the fault.c has been
> holding a set of attach/detach/replace helpers for attach_handle and iopf
> enabling/disabling.
> 
> Now, both the iommufd_msi series [1] and the attach_pasid series [2] want
> to reuse the attach_handle for non-fault cases. Rework the attach_handle,
> to prepare for either of the series. It should be merged with either that
> gets merged first.
> 
> [1] https://lore.kernel.org/linux-iommu/cover.1736550979.git.nicolinc@nvidia.com/
> [2] https://lore.kernel.org/linux-iommu/20241219132746.16193-1-yi.l.liu@intel.com/
> 
> Patches in this series are from [1] with some fixes addressing the review
> comments.

Applied, the other patches can rebase on top of this

Thanks,
Jason