public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] iommu: Clean up cookie and sw_msi in struct iommu_domain
@ 2025-03-03 20:52 Nicolin Chen
  2025-03-03 20:52 ` [PATCH v3 1/3] iommu: Sort out domain user data Nicolin Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Nicolin Chen @ 2025-03-03 20:52 UTC (permalink / raw)
  To: jgg, kevin.tian, robin.murphy, joro, will; +Cc: iommu, linux-kernel

A few things in iommu_domain structure (such as iova_cookie, iommufd_hwpt,
fault handler, and etc) are exclusive to certain types of iommu_domains.
So, all of them can be seen as domain cookies in different cookie types.

Furthermore, iova_cookie is shared with the msi_cookie use case. It could
be cleaner by decoupling these too.

Define an enum iommu_domain_cookie_type to fit all those cookies in.

Since there are only two sw_msi implementations, check domain->cookie_type
in iommu_dma_prepare_msi() to call the corresponding sw_msi function.

This is a clean-up series for the previous sw_msi Part-1 core series. It's
on github:
https://github.com/nicolinc/iommufd/commits/iommufd_msi_cleanup-v3

Changelog
v3
 * Integrate Robin's patch
   https://lore.kernel.org/linux-iommu/4e68d5820be06adc1b34fc0d1c9399481151daee.1740742271.git.robin.murphy@arm.com/
   replacing private_data_owner with the new cookie_type
 * Move iommu_sw_msi stub from the public header to iommu-priv.h
v2
 https://lore.kernel.org/all/cover.1740705776.git.nicolinc@nvidia.com/
 * Drop sw_msi function pointer
 * Add a new private_data_owner tag in iommu_domain
 * Let iommu core call the two sw_msi implementations directly
v1
 https://lore.kernel.org/all/cover.1740600272.git.nicolinc@nvidia.com/

Thanks
Nicolin

Nicolin Chen (2):
  iommufd: Move iommufd_sw_msi and related functions to driver.c
  iommu: Drop sw_msi from iommu_domain

Robin Murphy (1):
  iommu: Sort out domain user data

 drivers/iommu/dma-iommu.h               |  14 ++
 drivers/iommu/iommu-priv.h              |  13 ++
 drivers/iommu/iommufd/iommufd_private.h |   7 +-
 include/linux/iommu.h                   |  35 ++--
 drivers/iommu/dma-iommu.c               | 207 ++++++++++++------------
 drivers/iommu/iommu-sva.c               |   1 +
 drivers/iommu/iommu.c                   |  34 +++-
 drivers/iommu/iommufd/device.c          | 127 +--------------
 drivers/iommu/iommufd/driver.c          | 125 ++++++++++++++
 drivers/iommu/iommufd/hw_pagetable.c    |   4 +-
 10 files changed, 313 insertions(+), 254 deletions(-)


base-commit: 5e9f822c9c683ae884fa5e71df41d1647b2876c6
-- 
2.43.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-03-06 20:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03 20:52 [PATCH v3 0/3] iommu: Clean up cookie and sw_msi in struct iommu_domain Nicolin Chen
2025-03-03 20:52 ` [PATCH v3 1/3] iommu: Sort out domain user data Nicolin Chen
2025-03-05 15:08   ` kernel test robot
2025-03-05 15:18   ` kernel test robot
2025-03-05 15:45     ` Robin Murphy
2025-03-05 17:48       ` Nicolin Chen
2025-03-05 16:51   ` kernel test robot
2025-03-05 17:44   ` kernel test robot
2025-03-06  5:59   ` Tian, Kevin
2025-03-06 20:10     ` Nicolin Chen
2025-03-03 20:52 ` [PATCH v3 2/3] iommufd: Move iommufd_sw_msi and related functions to driver.c Nicolin Chen
2025-03-05 17:53   ` Jason Gunthorpe
2025-03-05 18:53     ` Nicolin Chen
2025-03-03 20:52 ` [PATCH v3 3/3] iommu: Drop sw_msi from iommu_domain Nicolin Chen
2025-03-04 14:50   ` Robin Murphy
2025-03-06  6:01   ` Tian, Kevin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox