All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Fix hwpt lifetime and detach bugs
@ 2023-02-13 18:02 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
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Jason Gunthorpe @ 2023-02-13 18:02 UTC (permalink / raw)
  To: iommu, Kevin Tian; +Cc: Lixiao Yang, Matthew Rosato, Nicolin Chen, Yi Liu

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
  iommufd: Assert devices_lock for iommufd_hw_pagetable_has_group()
  iommufd: Add iommufd_lock_obj() around the auto-domains hwpts
  iommufd: Simplify the lifecycle of a hwpt

 drivers/iommu/iommufd/device.c          | 47 +++++++++++++------------
 drivers/iommu/iommufd/hw_pagetable.c    | 25 +++++++++++++
 drivers/iommu/iommufd/iommufd_private.h |  2 ++
 3 files changed, 52 insertions(+), 22 deletions(-)


base-commit: bed9e516f1183faa0e484479701cc669efd9049a
-- 
2.39.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-02-22 12:43 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.