All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Yi Liu <yi.l.liu@intel.com>,
	joro@8bytes.org, jgg@nvidia.com, kevin.tian@intel.com
Cc: baolu.lu@linux.intel.com, alex.williamson@redhat.com,
	robin.murphy@arm.com, eric.auger@redhat.com, nicolinc@nvidia.com,
	kvm@vger.kernel.org, chao.p.peng@linux.intel.com,
	iommu@lists.linux.dev, zhenzhong.duan@intel.com,
	jacob.jun.pan@intel.com
Subject: Re: [PATCH v2 1/2] iommu: Undo pasid attachment only for the devices that have succeeded
Date: Wed, 3 Apr 2024 11:08:37 +0800	[thread overview]
Message-ID: <03a8e382-5fe0-4420-ace1-10a7107e5768@linux.intel.com> (raw)
In-Reply-To: <20240328122958.83332-2-yi.l.liu@intel.com>

On 3/28/24 8:29 PM, Yi Liu wrote:
> There is no error handling now in __iommu_set_group_pasid(), it relies on
> its caller to loop all the devices to undo the pasid attachment. This is
> not self-contained and has drawbacks. It would result in unnecessary
> remove_dev_pasid() calls on the devices that have not been attached to the
> new domain. But the remove_dev_pasid() callback would get the new domain
> from the group->pasid_array. So for such devices, the iommu driver won't
> find the attachment under the domain, hence unable to do cleanup. This may
> not be a real problem today. But it depends on the implementation of the
> underlying iommu driver. e.g. the intel iommu driver would warn for such
> devices. Such warnings are unnecessary.
> 
> To solve the above problem, it is necessary to handle the error within
> __iommu_set_group_pasid(). It only loops the devices that have attached
> to the new domain, and undo it.
> 
> Fixes: 16603704559c ("iommu: Add attach/detach_dev_pasid iommu interfaces")
> Suggested-by: Jason Gunthorpe<jgg@nvidia.com>
> Reviewed-by: Jason Gunthorpe<jgg@nvidia.com>
> Reviewed-by: Kevin Tian<kevin.tian@intel.com>
> Signed-off-by: Yi Liu<yi.l.liu@intel.com>

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>

Best regards,
baolu

  reply	other threads:[~2024-04-03  3:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 12:29 [PATCH v2 0/2] Two enhancements to iommu_at[de]tach_device_pasid() Yi Liu
2024-03-28 12:29 ` [PATCH v2 1/2] iommu: Undo pasid attachment only for the devices that have succeeded Yi Liu
2024-04-03  3:08   ` Baolu Lu [this message]
2024-03-28 12:29 ` [PATCH v2 2/2] iommu: Pass domain to remove_dev_pasid() op Yi Liu
2024-03-29  3:32   ` Tian, Kevin
2024-04-03  3:04   ` Baolu Lu
2024-04-03  3:25     ` Yi Liu
2024-04-05 18:17       ` Jason Gunthorpe
2024-03-29  2:12 ` [PATCH v2 0/2] Two enhancements to iommu_at[de]tach_device_pasid() Duan, Zhenzhong
2024-03-29  3:38   ` Yi Liu
2024-03-29  5:31     ` Duan, Zhenzhong
2024-04-03  2:56   ` Baolu Lu
2024-04-03  4:14     ` Duan, Zhenzhong
2024-04-12 10:13 ` Joerg Roedel

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=03a8e382-5fe0-4420-ace1-10a7107e5768@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=eric.auger@redhat.com \
    --cc=iommu@lists.linux.dev \
    --cc=jacob.jun.pan@intel.com \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.com \
    --cc=yi.l.liu@intel.com \
    --cc=zhenzhong.duan@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 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.