On Thu, Aug 15, 2024 at 12:53:04PM -0700, Nicolin Chen wrote:

> > Maybe the iommufd_viommu_invalidate ioctl handler should hold that
> > xa_lock around the viommu->ops->cache_invalidate, and then add lock
> > assert in iommufd_viommu_find_device?
> 
> xa_lock/spinlock might be too heavy. We can have a mutex to wrap
> around viommu ioctl handlers..

A rw semaphore might be reasonable.

Jason

Reply via email to