Linux IOMMU Development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	"Yang, Lixiao" <lixiao.yang@intel.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	Nicolin Chen <nicolinc@nvidia.com>,
	"Liu, Yi L" <yi.l.liu@intel.com>
Subject: Re: [PATCH 0/4] Fix hwpt lifetime and detach bugs
Date: Wed, 22 Feb 2023 08:43:30 -0400	[thread overview]
Message-ID: <Y/YN8jsZmveoFVIV@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB527647F6F32BA61775F348E28CAA9@BN9PR11MB5276.namprd11.prod.outlook.com>

On Wed, Feb 22, 2023 at 02:14:42AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Thursday, February 16, 2023 9:37 AM
> > 
> > On Mon, Feb 13, 2023 at 02:02:41PM -0400, Jason Gunthorpe wrote:
> > > As discussed here is a small series to address the confusing lifetime
> > > scheme for the hwpt. This was some leftover from prior rework that was
> > > never fully cleaned up.
> > >
> > > Make it clear that the ioas and ioas->hwpt_list are associated with the
> > > hwpt during creation and never changed until it is destroyed. A
> > > post-finalize hwpt with a positive reference count is always valid for
> > > device attachment.
> > >
> > > This should simplify the nesting and replace series.
> > >
> > > Jason Gunthorpe (4):
> > >   iommufd: Do not add the same hwpt to the ioas->hwpt_list twice
> > 
> > I've applied this patch to the tree
> > 
> > And my v2 of this series is here now:
> > 
> > https://github.com/jgunthorpe/linux/commits/iommufd_hwpt
> > 
> > Which is completely redone
> > 
> > I will try to make the patches to do replace and alloc hwpt on top of
> > this, I think it fixes all the locking and consistency problems.
> > 
> 
> with group now explicitly tracked in iommufd presumably iommufd
> can continue to use iommu_attach_group() instead of switching to
> iommu_attach_device() as previously planned?

Yes, it seems necessary.

The only other option I could think of was to expose more of the
core's iommu_group struct for owner usage.

Jason

      reply	other threads:[~2023-02-22 12:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 18:02 [PATCH 0/4] Fix hwpt lifetime and detach bugs Jason Gunthorpe
2023-02-13 18:02 ` [PATCH 1/4] iommufd: Do not add the same hwpt to the ioas->hwpt_list twice Jason Gunthorpe
2023-02-14  5:51   ` Tian, Kevin
2023-02-14 15:14     ` Jason Gunthorpe
2023-02-15  1:39       ` Tian, Kevin
2023-02-13 18:02 ` [PATCH 2/4] iommufd: Assert devices_lock for iommufd_hw_pagetable_has_group() Jason Gunthorpe
2023-02-14  5:52   ` Tian, Kevin
2023-02-13 18:02 ` [PATCH 3/4] iommufd: Add iommufd_lock_obj() around the auto-domains hwpts Jason Gunthorpe
2023-02-14  5:55   ` Tian, Kevin
2023-02-13 18:02 ` [PATCH 4/4] iommufd: Simplify the lifecycle of a hwpt Jason Gunthorpe
2023-02-14  6:14   ` Tian, Kevin
2023-02-14 10:41     ` Nicolin Chen
2023-02-14 16:32     ` Jason Gunthorpe
2023-02-16  1:36 ` [PATCH 0/4] Fix hwpt lifetime and detach bugs Jason Gunthorpe
2023-02-22  2:14   ` Tian, Kevin
2023-02-22 12:43     ` Jason Gunthorpe [this message]

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=Y/YN8jsZmveoFVIV@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=iommu@lists.linux.dev \
    --cc=kevin.tian@intel.com \
    --cc=lixiao.yang@intel.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=nicolinc@nvidia.com \
    --cc=yi.l.liu@intel.com \
    /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