public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolin Chen <nicolinc@nvidia.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: <robin.murphy@arm.com>, <joro@8bytes.org>, <will@kernel.org>,
	<alex.williamson@redhat.com>, <iommu@lists.linux.dev>,
	<linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>
Subject: Re: [PATCH v1 2/4] iommu: Add iommu_default_domain_free helper
Date: Thu, 27 Feb 2025 15:32:12 -0800	[thread overview]
Message-ID: <Z8D1/BWdTY4TtoB3@Asurada-Nvidia> (raw)
In-Reply-To: <20250227210336.GP39591@nvidia.com>

On Thu, Feb 27, 2025 at 05:03:36PM -0400, Jason Gunthorpe wrote:
> On Thu, Feb 27, 2025 at 12:59:04PM -0800, Nicolin Chen wrote:
> > On Thu, Feb 27, 2025 at 03:50:36PM -0400, Jason Gunthorpe wrote:
> > > On Wed, Feb 26, 2025 at 12:16:05PM -0800, Nicolin Chen wrote:
> > > > The iommu_put_dma_cookie() will be moved out of iommu_domain_free(). For a
> > > > default domain, iommu_put_dma_cookie() can be simply added to this helper.
> > > > 
> > > > Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
> > > > Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
> > > > ---
> > > >  drivers/iommu/iommu.c | 11 ++++++++---
> > > >  1 file changed, 8 insertions(+), 3 deletions(-)
> > > 
> > > Let's try to do what Robin suggested and put a private_data_owner
> > > value in the struct then this patch isn't used, we'd just do
> > > 
> > >       if (domain->private_data_owner == DMA)
> > > 	iommu_put_dma_cookie(domain);
> > > 
> > > Instead of this change and the similar VFIO change
> > 
> > Ack. I assume I should go with a smaller series starting with this
> > "private_data_owner", and then later a bigger series for the other
> > bits like translation_type that you mentioned in the other thread.
> 
> That could work, you could bitfiled type and steal a few bits for
> "private_data_owner" ?
> 
> Then try the sw_msi removal at the same time too?

Ack. I drafted four patches:
  iommu: Add private_data_owner to iommu_domain_free
  iommu: Turn iova_cookie to dma-iommu private pointer
  iommufd: Move iommufd_sw_msi and related functions to driver.c
  iommu: Drop sw_msi from iommu_domain

Will do some proper build tests and then wrap them up.

Thanks
Nicolin

  reply	other threads:[~2025-02-27 23:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-26 20:16 [PATCH v1 0/4] iommu: Isolate iova_cookie to actual owners Nicolin Chen
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 [this message]
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=Z8D1/BWdTY4TtoB3@Asurada-Nvidia \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox