Description of problem: In legacy vIOMMU mode, VM with MDEV device passthrough live migration failed. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Create 2 VMs with DSA MDEV device using legacy vIOMMU 2. Start to run endless kernel dmatest in migrate source VM 3. Start to migrate VM Actual results: Migration ended but kernel dmatest reported failure in the migrate destination VM. Expected results: Additional info: VM Error logs: [ 31.952180] dmatest: dma0chan0-copy0: dstbuf[0x2e4b] not copied! Expected c9, got 09 [ 31.952181] dmatest: dma0chan0-copy0: dstbuf[0x2e4c] not copied! Expected c8, got 08 [ 31.952181] dmatest: dma0chan0-copy0: dstbuf[0x2e4d] not copied! Expected c7, got 07 [ 31.952182] dmatest: dma0chan0-copy0: dstbuf[0x2e4e] not copied! Expected c6, got 06 [ 31.952183] dmatest: dma0chan0-copy0: dstbuf[0x2e4f] not copied! Expected c5, got 05 [ 31.952183] dmatest: dma0chan0-copy0: dstbuf[0x2e50] not copied! Expected c4, got 04 [ 31.952184] dmatest: dma0chan0-copy0: dstbuf[0x2e51] not copied! Expected c3, got 03 [ 31.952185] dmatest: dma0chan0-copy0: dstbuf[0x2e52] not copied! Expected c2, got 02 [ 31.952185] dmatest: dma0chan0-copy0: dstbuf[0x2e53] not copied! Expected c1, got 01 [ 31.952186] dmatest: dma0chan0-copy0: dstbuf[0x2e54] not copied! Expected c0, got 00 [ 31.952187] dmatest: dma0chan0-copy0: dstbuf[0x2e55] not copied! Expected df, got 1f [ 31.952187] dmatest: dma0chan0-copy0: dstbuf[0x2e56] not copied! Expected de, got 1e [ 31.952188] dmatest: dma0chan0-copy0: dstbuf[0x2e57] not copied! Expected dd, got 1d [ 31.952189] dmatest: dma0chan0-copy0: dstbuf[0x2e58] not copied! Expected dc, got 1c [ 31.952189] dmatest: dma0chan0-copy0: dstbuf[0x2e59] not copied! Expected db, got 1b [ 31.952190] dmatest: dma0chan0-copy0: dstbuf[0x2e5a] not copied! Expected da, got 1a [ 31.952190] dmatest: dma0chan0-copy0: dstbuf[0x2e5b] not copied! Expected d9, got 19 [ 31.952191] dmatest: dma0chan0-copy0: dstbuf[0x2e5c] not copied! Expected d8, got 18 [ 31.952192] dmatest: dma0chan0-copy0: dstbuf[0x2e5d] not copied! Expected d7, got 17 [ 31.952192] dmatest: dma0chan0-copy0: dstbuf[0x2e5e] not copied! Expected d6, got 16 [ 31.952192] dmatest: dma0chan0-copy0: dstbuf[0x2e5f] not copied! Expected d5, got 15 [ 31.952193] dmatest: dma0chan0-copy0: dstbuf[0x2e60] not copied! Expected d4, got 14 [ 31.952193] dmatest: dma0chan0-copy0: dstbuf[0x2e61] not copied! Expected d3, got 13 [ 31.952194] dmatest: dma0chan0-copy0: dstbuf[0x2e62] not copied! Expected d2, got 12 [ 31.952194] dmatest: dma0chan0-copy0: dstbuf[0x2e63] not copied! Expected d1, got 11 [ 31.952195] dmatest: dma0chan0-copy0: dstbuf[0x2e64] not copied! Expected d0, got 10 [ 31.952195] dmatest: dma0chan0-copy0: dstbuf[0x2e65] not copied! Expected cf, got 0f [ 31.952196] dmatest: dma0chan0-copy0: dstbuf[0x2e66] not copied! Expected ce, got 0e [ 31.952196] dmatest: dma0chan0-copy0: dstbuf[0x2e67] not copied! Expected cd, got 0d [ 31.952197] dmatest: dma0chan0-copy0: dstbuf[0x2e68] not copied! Expected cc, got 0c [ 31.952202] dmatest: dma0chan0-copy0: 4131 errors suppressed [ 31.952203] dmatest: dma0chan0-copy0: result #115485: 'data error' with src_off=0xfd4 dst_off=0x2e49 len=0x1043 (4163) qemu error logs: qemu-system-x86_64: Failed to get dirty bitmap for iova: 0xffffd000 size: 0x1000 err: 14 qemu-system-x86_64: vfio_iommu_map_dirty_notify(0x556111450880, 0xffffd000, 0x1000) = -1 (Bad address) qemu-system-x86_64: Failed to get dirty bitmap for iova: 0xffffe000 size: 0x1000 err: 14 qemu-system-x86_64: vfio_iommu_map_dirty_notify(0x556111450880, 0xffffe000, 0x1000) = -1 (Bad address) qemu-system-x86_64: Failed to get dirty bitmap for iova: 0xfffff000 size: 0x1000 err: 14 qemu-system-x86_64: vfio_iommu_map_dirty_notify(0x556111450880, 0xfffff000, 0x1000) = -1 (Bad address)
merged: https://gitee.com/anolis/cloud-kernel/pulls/600