Hi, This series relax the vIOMMU check and allows live migration with vIOMMU without VFs using device dirty tracking. It's rewritten based on first 4 patches of [1] from Joao.
Currently what block us is the lack of dirty bitmap query with iommufd before unmap. By adding that query in patch2 plus an extra optimization in patch3 that let us simply read the dirty bit (without clearing it), then an optimization in patch4 to handle a corner case of domain switch in guest, finally we relax the check in patch5. We tested VM live migration (running QAT workload in VM) with QAT device passthrough, below matrix configs: 1.Scalable mode vIOMMU + IOMMUFD cdev mode 2.Scalable mode vIOMMU + legacy VFIO mode 3.legacy mode vIOMMU + IOMMUFD cdev mode 4.legacy mode vIOMMU + legacy VFIO mode [1] https://github.com/jpemartins/qemu/commits/vfio-migration-viommu/ Thanks Zhenzhong Zhenzhong Duan (5): vfio/iommufd: Add framework code to support getting dirty bitmap before unmap vfio/iommufd: Query dirty bitmap before DMA unmap vfio/iommufd: Add IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR flag support intel_iommu: Optimize unmap_bitmap during migration vfio/migration: Allow live migration with vIOMMU without VFs using device dirty tracking hw/vfio/vfio-iommufd.h | 1 + include/hw/vfio/vfio-device.h | 10 ++++++ include/system/iommufd.h | 2 +- backends/iommufd.c | 5 +-- hw/i386/intel_iommu.c | 42 ++++++++++++++++++++++ hw/vfio/container-base.c | 5 +-- hw/vfio/device.c | 6 ++++ hw/vfio/iommufd.c | 66 +++++++++++++++++++++++++++++------ hw/vfio/migration.c | 6 ++-- backends/trace-events | 2 +- 10 files changed, 123 insertions(+), 22 deletions(-) -- 2.47.1
