From: Nicolin Chen <nicolinc@nvidia.com>
To: <jgg@nvidia.com>, <kevin.tian@intel.com>, <robin.murphy@arm.com>,
<joro@8bytes.org>, <will@kernel.org>
Cc: <iommu@lists.linux.dev>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v4 0/3] iommu: Clean up cookie and sw_msi in struct iommu_domain
Date: Thu, 6 Mar 2025 13:00:46 -0800 [thread overview]
Message-ID: <cover.1741294235.git.nicolinc@nvidia.com> (raw)
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-v4
Changelog
v4
* Rebase on top of a bug fix for hwpt_iommufd cookie
https://lore.kernel.org/all/20250305211800.229465-1-nicolinc@nvidia.com/
* Add Reviewed-by from Robin and Kevin
* Add missing "break;" in iommu_domain_free()
* Drop "linux/msi.h" header from the iommufd/device code
* Set iommufd_sw_msi_install's SYMBOL to "IOMMUFD_INTERNAL"
* Update commit messages for typo fixing and size comparison
* Add a local msi_page_list to cache cookie_msi_pages(domain) return
* Add an inline iommufd_group_setup_msi() for !CONFIG_IRQ_MSI_IOMMU
v3
https://lore.kernel.org/all/cover.1741034885.git.nicolinc@nvidia.com/
* 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 | 208 ++++++++++++------------
drivers/iommu/iommu-sva.c | 1 +
drivers/iommu/iommu.c | 35 +++-
drivers/iommu/iommufd/device.c | 131 +--------------
drivers/iommu/iommufd/driver.c | 125 ++++++++++++++
drivers/iommu/iommufd/hw_pagetable.c | 6 +-
10 files changed, 320 insertions(+), 255 deletions(-)
base-commit: 4b022ff93d8b332891cae818a7331942db50610f
--
2.43.0
next reply other threads:[~2025-03-06 21:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 21:00 Nicolin Chen [this message]
2025-03-06 21:00 ` [PATCH v4 1/3] iommu: Sort out domain user data Nicolin Chen
2025-03-07 2:28 ` Baolu Lu
2025-03-07 5:57 ` Nicolin Chen
2025-03-07 7:03 ` Baolu Lu
2025-03-07 11:49 ` Robin Murphy
2025-03-07 15:32 ` Jason Gunthorpe
2025-03-17 19:37 ` Jason Gunthorpe
2025-03-06 21:00 ` [PATCH v4 2/3] iommufd: Move iommufd_sw_msi and related functions to driver.c Nicolin Chen
2025-03-12 7:37 ` Tian, Kevin
2025-03-17 20:20 ` Jason Gunthorpe
2025-03-06 21:00 ` [PATCH v4 3/3] iommu: Drop sw_msi from iommu_domain Nicolin Chen
2025-03-17 20:20 ` Jason Gunthorpe
2025-03-24 16:25 ` Nathan Chancellor
2025-03-24 16:40 ` Jason Gunthorpe
2025-03-24 16:55 ` Nicolin Chen
2025-03-24 17:05 ` Nicolin Chen
2025-03-24 17:07 ` Nathan Chancellor
2025-03-24 20:05 ` Jason Gunthorpe
2025-03-24 20:43 ` Nathan Chancellor
2025-03-24 21:38 ` Nicolin Chen
2025-03-24 22:29 ` Jason Gunthorpe
2025-03-24 22:45 ` Nicolin Chen
2025-03-17 20:21 ` [PATCH v4 0/3] iommu: Clean up cookie and sw_msi in struct iommu_domain Jason Gunthorpe
2025-03-20 23:16 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1741294235.git.nicolinc@nvidia.com \
--to=nicolinc@nvidia.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox