On Mon, Jul 03, 2023 at 01:27:51PM +0800, Cao, Yahui wrote: > > > You can't call VFIO functions from a netdev driver. All this code > > > needs to be moved into the varient driver. > > Will move vfio_dma_rw() into vfio driver and passing callback function into > netdev driver Please make proper layers, you should not need to stitch your driver together with weird function pointers. > > > We also don't have any guarentees defined for the VFIO protocol about > > > what state the vIOMMU will be in prior to reaching RUNNING. > > This is a good point. Actually it's not just a gap on vIOMMU. it's kind > > of a dependency on IOMMUFD no matter the IOAS which the migrated > > device is currently attached to is GPA or GIOVA. The device state can > > be restored only after IOMMUFD is fully recovered and the device is > > re-attached to the IOAS. > > > > Need a way for migration driver to advocate such dependency to the user. > > Since this part is new to me, may need further guidance on how to resolve > the dependency from you and other community experts. Personally I'm quite uncomfortable with a driver that tries to work this way, I'm not sure we should encourage this. Can Intel really be convincing that this is safe and correct? Jason