Re: [RFC PATCH 04/10] vfio/pci: Use vfio_device_unmap_mapping_range()

2021-02-24 Thread Jason Gunthorpe
On Wed, Feb 24, 2021 at 02:55:05PM -0700, Alex Williamson wrote: > Ok, but how does this really help us, unless you're also proposing some > redesign of the memory_lock semaphore? Even if we're zapping all the > affected devices for a bus reset that doesn't eliminate that we still > require

Re: [RFC PATCH 04/10] vfio/pci: Use vfio_device_unmap_mapping_range()

2021-02-24 Thread Alex Williamson
On Mon, 22 Feb 2021 13:22:30 -0400 Jason Gunthorpe wrote: > On Mon, Feb 22, 2021 at 09:51:13AM -0700, Alex Williamson wrote: > > > + vfio_device_unmap_mapping_range(vdev->device, > > + VFIO_PCI_INDEX_TO_OFFSET(VFIO_PCI_BAR0_REGION_INDEX), > > +

Re: [RFC PATCH 04/10] vfio/pci: Use vfio_device_unmap_mapping_range()

2021-02-22 Thread Jason Gunthorpe
On Mon, Feb 22, 2021 at 09:51:13AM -0700, Alex Williamson wrote: > + vfio_device_unmap_mapping_range(vdev->device, > + VFIO_PCI_INDEX_TO_OFFSET(VFIO_PCI_BAR0_REGION_INDEX), > + VFIO_PCI_INDEX_TO_OFFSET(VFIO_PCI_ROM_REGION_INDEX) - > +

[RFC PATCH 04/10] vfio/pci: Use vfio_device_unmap_mapping_range()

2021-02-22 Thread Alex Williamson
With the vfio device fd tied to the address space of the pseudo fs inode, we can use the mm to track all vmas that might be mmap'ing device BARs, which removes our vma_list and all the complicated lock ordering necessary to manually zap each related vma. Suggested-by: Jason Gunthorpe