On Tue, Apr 12, 2022 at 12:53:28PM -0300, Jason Gunthorpe wrote: > All callers have a struct vfio_device trivially available, pass it in > directly and avoid calling the expensive vfio_group_get_from_dev().
Instead of bothering the drivers with the notifiers at all, the two notifier_blocks should move into struct vfio_device, and the vfio_ops should just grow two new dma_unmap and set_kvm methods. This will isolate the drives from the whole notifiers mess and it's boilerplate code.