On Fri, Nov 04, 2022 at 05:43:29AM +0000, Tian, Kevin wrote: > > From: Jason Gunthorpe <jgg@xxxxxxxxxx> > > Sent: Friday, November 4, 2022 9:01 AM > > > > The only way I can see to solve this is to hold a serializing lock > > across iommufd_access_pin_pages() so that neither > > iommufd_test_access_unmap() can progress until both the pin is > > completed and the record of the pin is stored. > > same as gvt does which maintains an internal mapping cache and > conducts pin/unmap with cache update under the mutex protection. Yeah, that does actually look OK Jason