Currently virtio-iommu's logic to support bypass mode works only for emulated device. For assigned device, no GPA -> HPA mapping is setup in IOMMU page table.
Host report below error: [3713481.750944] dmar_fault: 191 callbacks suppressed [3713481.750953] DMAR: DRHD: handling fault status reg 302 [3713481.750962] DMAR: [DMA Read NO_PASID] Request device [2f:00.1] fault addr 0x7ebb0000 [fault reason 0x06] PTE Read access is not set [3713481.751003] DMAR: DRHD: handling fault status reg 402 [3713481.751007] DMAR: [DMA Read NO_PASID] Request device [2f:00.1] fault addr 0x7ebb0000 [fault reason 0x06] PTE Read access is not set [3713481.751023] DMAR: DRHD: handling fault status reg 502 [3713481.751026] DMAR: [DMA Write NO_PASID] Request device [2f:00.1] fault addr 0x7ebb0000 [fault reason 0x05] PTE Write access is not set [3713481.751072] DMAR: DRHD: handling fault status reg 602 Guest kernel report below error: [ 3.461716] i40e: Intel(R) Ethernet Connection XL710 Network Driver [ 3.462605] i40e: Copyright (c) 2013 - 2019 Intel Corporation. [ 3.464630] i40e 0000:00:04.0: Adding to iommu group 5 [ 3.482093] i40e 0000:00:04.0: fw 0.0.00000 api 0.0 nvm 0.00 0x176953ce 28.50.1 [8086:37d3] [8086:35d0] [ 3.484295] i40e 0000:00:04.0: eeprom check failed (-62), Tx/Rx traffic disabled [ 3.487268] i40e 0000:00:04.0: configure_lan_hmc failed: -49 [ 3.489066] i40e: probe of 0000:00:04.0 failed with error -2 Fix it by adding switch beween bypass and iommu address space just like the virtual VT-d implementation, so that in bypass mode, vfio mapping is setup. Tested with four combination of qemu's virtio-iommu.boot-bypass=true/false with guest kernel's iommu=pt/nopt on x86_64 platform. Zhenzhong Duan (3): virtio-iommu: Add bypass mode support to assigned device virtio-iommu: Use recursive lock to avoid deadlock virtio-iommu: Add an assert check in translate routine hw/virtio/trace-events | 1 + hw/virtio/virtio-iommu.c | 135 ++++++++++++++++++++++++++++--- include/hw/virtio/virtio-iommu.h | 4 +- 3 files changed, 130 insertions(+), 10 deletions(-) -- 2.25.1