From: Nicolin Chen <nicolinc@nvidia.com>
To: <robin.murphy@arm.com>, <joro@8bytes.org>, <will@kernel.org>,
<alex.williamson@redhat.com>
Cc: <jgg@nvidia.com>, <iommu@lists.linux.dev>,
<linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>
Subject: [PATCH v1 0/4] iommu: Isolate iova_cookie to actual owners
Date: Wed, 26 Feb 2025 12:16:03 -0800 [thread overview]
Message-ID: <cover.1740600272.git.nicolinc@nvidia.com> (raw)
Now, iommufd implements its own sw_msi function that does not touch the
domain->iova_cookie but domain->iommufd_hwpt, as a domain owner pointer.
Isolate the iova_cookie from iommufd by putting it into the union where
the iommufd_hwpt is located.
This requires a set of preparations to move iommu_put_dma_cookie() out
of the common path of iommu_domain_free() that iommufd still calls.
Make thing cleaner that any caller of iommu_get_dma/msi_cookie() should
explicitly call the pairing iommu_put_dma/msi_cookie().
This is a clean-up series for the sw_msi Part-1 core series, prior to
the Part-2/3 series. It's on github:
https://github.com/nicolinc/iommufd/commits/iommufd_msi_cleanup-v1
Thanks
Nicolin
Nicolin Chen (4):
iommu: Define iommu_get/put_msi_cookie() under CONFIG_IRQ_MSI_IOMMU
iommu: Add iommu_default_domain_free helper
iommu: Request iova_cookie owner to put cookie explicitly
iommu: Turn iova_cookie to dma-iommu private pointer
include/linux/iommu.h | 12 ++++++++----
drivers/iommu/dma-iommu.c | 12 ++++++++++++
drivers/iommu/iommu.c | 13 +++++++++----
drivers/vfio/vfio_iommu_type1.c | 4 ++++
4 files changed, 33 insertions(+), 8 deletions(-)
base-commit: 598749522d4254afb33b8a6c1bea614a95896868
--
2.43.0
next reply other threads:[~2025-02-26 20:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 20:16 Nicolin Chen [this message]
2025-02-26 20:16 ` [PATCH v1 1/4] iommu: Define iommu_get/put_msi_cookie() under CONFIG_IRQ_MSI_IOMMU Nicolin Chen
2025-02-26 20:16 ` [PATCH v1 2/4] iommu: Add iommu_default_domain_free helper Nicolin Chen
2025-02-27 19:50 ` Jason Gunthorpe
2025-02-27 20:59 ` Nicolin Chen
2025-02-27 21:03 ` Jason Gunthorpe
2025-02-27 23:32 ` Nicolin Chen
2025-02-28 11:20 ` Robin Murphy
2025-02-26 20:16 ` [PATCH v1 3/4] iommu: Request iova_cookie owner to put cookie explicitly Nicolin Chen
2025-02-26 20:16 ` [PATCH v1 4/4] iommu: Turn iova_cookie to dma-iommu private pointer Nicolin Chen
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.1740600272.git.nicolinc@nvidia.com \
--to=nicolinc@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.