Test steps on Jammy. Output is provided for each test with the QEMU versions in -updates and test packages in a PPA. RELEASE=jammy ... $ dpkg -s qemu-system-x86 | grep Version: Version: 1:6.2+dfsg-2ubuntu6.6 $ dpkg -s qemu-system-x86 | grep Version: Version: 1:6.2+dfsg-2ubuntu6.7 ... $ sudo qemu-system-x86_64 -nographic -device vfio-pci,host=$PCI -M pc -m 1035265 qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0: VFIO_MAP_DMA failed: Invalid argument qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0: vfio 0000:00:03.0: failed to setup container for group 2: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x55622b0fed30, 0x100000000, 0xfc00100000, 0x7ec3e5400000) = -22 (Invalid argument) $ sudo qemu-system-x86_64 -nographic -device vfio-pci,host=$PCI -M pc -m 1035265 qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0: VFIO_MAP_DMA failed: Invalid argument (hint: AMD IOMMU: reduce VM ram) qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0: vfio 0000:00:03.0: failed to setup container for group 2: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x5650c6e5fd30, 0x100000000, 0xfc00100000, 0x7eca21400000) = -22 (Invalid argument) ... $ sudo qemu-system-x86_64 -nographic -device vfio-pci,host=$PCI -M pc -m 1035264 [ 234.987422] Out of memory: Killed process 1525 (qemu-system-x86) total-vm:1060937100kB, anon-rss:3748652kB, file-rss:2672kB, shmem-rss:0kB, UID:0 pgtables:7508kB oom_score_adj:0 Killed $ sudo qemu-system-x86_64 -nographic -device vfio-pci,host=$PCI -M pc -m 1035264 [ 263.021576] Out of memory: Killed process 1547 (qemu-system-x86) total-vm:1060937100kB, anon-rss:3738324kB, file-rss:2404kB, shmem-rss:0kB, UID:0 pgtables:7484kB oom_score_adj:0 Killed ... $ sudo qemu-system-x86_64 -nographic -device vfio-pci,host=$PCI -M q35 -m 1034241 qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0: VFIO_MAP_DMA failed: Invalid argument qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0: vfio 0000:00:03.0: failed to setup container for group 2: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x55f6c1e067b0, 0x100000000, 0xfc00100000, 0x7ef2b1400000) = -22 (Invalid argument) $ sudo qemu-system-x86_64 -nographic -device vfio-pci,host=$PCI -M q35 -m 1034241 qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0: VFIO_MAP_DMA failed: Invalid argument (hint: AMD IOMMU: reduce VM ram) qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0: vfio 0000:00:03.0: failed to setup container for group 2: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x55d58ab8c7b0, 0x100000000, 0xfc00100000, 0x7e3b85400000) = -22 (Invalid argument) ... $ sudo qemu-system-x86_64 -nographic -device vfio-pci,host=$PCI -M q35 -m 1034240 [ 274.289579] Out of memory: Killed process 1545 (qemu-system-x86) total-vm:1059888832kB, anon-rss:3748872kB, file-rss:2408kB, shmem-rss:0kB, UID:0 pgtables:7508kB oom_score_adj:0 Killed $ sudo qemu-system-x86_64 -nographic -device vfio-pci,host=$PCI -M q35 -m 1034240 [ 319.704136] Out of memory: Killed process 1614 (qemu-system-x86) total-vm:1059888832kB, anon-rss:3740256kB, file-rss:2520kB, shmem-rss:0kB, UID:0 pgtables:7492kB oom_score_adj:0 Killed ... $ cat vm.xml vm hvm 1035265
$ virsh create vm.xml error: Failed to create domain from vm.xml error: internal error: qemu unexpectedly closed the monitor: 2023-03-04T22:39:10.092864Z qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0,id=hostdev0,bus=pci.0,addr=0x2: VFIO_MAP_DMA failed: Invalid argument 2023-03-04T22:39:10.161600Z qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0,id=hostdev0,bus=pci.0,addr=0x2: vfio 0000:00:03.0: failed to setup container for group 2: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x564f10c231f0, 0x100000000, 0xfc00100000, ) $ virsh create vm.xml error: Failed to create domain from vm.xml error: internal error: qemu unexpectedly closed the monitor: 2023-03-04T23:23:04.256407Z qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0,id=hostdev0,bus=pci.0,addr=0x2: VFIO_MAP_DMA failed: Invalid argument (hint: AMD IOMMU: reduce VM ram) 2023-03-04T23:23:04.333731Z qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0,id=hostdev0,bus=pci.0,addr=0x2: vfio 0000:00:03.0: failed to setup container for group 2: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x564d804e61f0, 0x100000000, 0xfc00100000, 0x7e27d9400000) = -22 (Invalid argument) ... $ sed s/1035265/1035264/ -i vm.xml $ virsh create vm.xml [ 323.339015] Out of memory: Killed process 1620 (qemu-system-x86) total-vm:1060989352kB, anon-rss:3738620kB, file-rss:2480kB, shmem-rss:0kB, UID:64055 pgtables:7492kB oom_score_adj:0 error: Failed to create domain from vm.xml error: internal error: process exited while connecting to monitor $ virsh create vm.xml [ 405.938376] Out of memory: Killed process 1758 (qemu-system-x86) total-vm:1060989352kB, anon-rss:3729028kB, file-rss:2612kB, shmem-rss:0kB, UID:64055 pgtables:7460kB oom_score_adj:0 error: Failed to create domain from vm.xml error: internal error: process exited while connecting to monitor ... $ cat vm.xml vm hvm 1034241
$ virsh create vm.xml error: Failed to create domain from vm.xml error: internal error: qemu unexpectedly closed the monitor: 2023-03-04T22:39:49.891100Z qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0,id=hostdev0,bus=pci.3,addr=0x1: VFIO_MAP_DMA failed: Invalid argument 2023-03-04T22:39:49.940878Z qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0,id=hostdev0,bus=pci.3,addr=0x1: vfio 0000:00:03.0: failed to setup container for group 2: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x5654f92fed40, 0x100000000, 0xfc00100000, ) $ virsh create vm.xml error: Failed to create domain from vm.xml error: internal error: qemu unexpectedly closed the monitor: 2023-03-04T23:22:37.437632Z qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0,id=hostdev0,bus=pci.3,addr=0x1: VFIO_MAP_DMA failed: Invalid argument (hint: AMD IOMMU: reduce VM ram) 2023-03-04T23:22:37.475306Z qemu-system-x86_64: -device vfio-pci,host=0000:00:03.0,id=hostdev0,bus=pci.3,addr=0x1: vfio 0000:00:03.0: failed to setup container for group 2: memory listener initialization failed: Region pc.ram: vfio_dma_map(0x563958b30d40, 0x100000000, 0xfc00100000, 0x7eff31400000) = -22 (Invalid argument) ... $ sed s/1034241/1034240/ -i vm.xml $ virsh create vm.xml [ 369.439912] Out of memory: Killed process 1692 (qemu-system-x86) total-vm:1059950088kB, anon-rss:3741496kB, file-rss:2632kB, shmem-rss:0kB, UID:64055 pgtables:7492kB oom_score_adj:0 error: Failed to create domain from vm.xml error: internal error: process exited while connecting to monitor $ virsh create vm.xml [ 347.505012] Out of memory: Killed process 1652 (qemu-system-x86) total-vm:1059950088kB, anon-rss:3734352kB, file-rss:2648kB, shmem-rss:0kB, UID:64055 pgtables:7468kB oom_score_adj:0 error: Failed to create domain from vm.xml error: internal error: process exited while connecting to monitor