Re: [PATCH 1/2] iommu: Pass domain to remove_dev_pasid() op

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 2024/3/27 21:02, Jason Gunthorpe wrote:
On Wed, Mar 27, 2024 at 05:54:32AM -0700, Yi Liu wrote:
Existing remove_dev_pasid() callbacks of the underlying iommu drivers get
the attached domain from the group->pasid_array. However, the domains
stored in group->pasid_array are not always correct. For example, the
set_dev_pasid() path updates group->pasid_array first and then invoke
remove_dev_pasid() callback when error happened. The remove_dev_pasid()
callback would get the updated domain. This is not correct for the
devices that are still attached with an old domain or just no attached

To avoid the above problem, passing the attached domain to the
remove_dev_pasid() callback is more reliable.

I've relaized we have the same issue with set_dev_pasid, there is no
way for the driver to get the old domain since the xarray was updated
before calling set_dev_pasid. This is unlike the RID path. Meaning
drivers can't implement PASID replace.

So we need another patch to pass the old domain into set_dev_pasid

This looks fine

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

I dropped your r-b as the description changed. Please have another look
at the v2 of this patch. :)


Yi Liu

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux