Linux IOMMU Development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: iommu@lists.linux.dev, Kevin Tian <kevin.tian@intel.com>
Cc: Lixiao Yang <lixiao.yang@intel.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	Nicolin Chen <nicolinc@nvidia.com>, Yi Liu <yi.l.liu@intel.com>
Subject: Re: [PATCH 0/4] Fix hwpt lifetime and detach bugs
Date: Wed, 15 Feb 2023 21:36:50 -0400	[thread overview]
Message-ID: <Y+2Isu/aAPm6PfeX@nvidia.com> (raw)
In-Reply-To: <0-v1-4336b5cb2fe4+1d7-iommufd_hwpt_jgg@nvidia.com>

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.

Jason

  parent reply	other threads:[~2023-02-16  1:36 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 ` Jason Gunthorpe [this message]
2023-02-22  2:14   ` [PATCH 0/4] Fix hwpt lifetime and detach bugs Tian, Kevin
2023-02-22 12:43     ` 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=Y+2Isu/aAPm6PfeX@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