mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
virtio-iommu: Add bypass mode support to assigned device
Currently assigned devices can not work in virtio-iommu bypass mode. Guest driver fails to probe the device due to DMA failure. And the reason is because of lacking GPA -> HPA mappings when VM is created. Add a root container memory region to hold both bypass memory region and iommu memory region, so the switch between them is supported just like the implementation in virtual VT-d. Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Message-Id: <20220613061010.2674054-2-zhenzhong.duan@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
b595d6272e
commit
90519b9053
3 changed files with 116 additions and 2 deletions
|
@ -37,6 +37,8 @@ typedef struct IOMMUDevice {
|
|||
int devfn;
|
||||
IOMMUMemoryRegion iommu_mr;
|
||||
AddressSpace as;
|
||||
MemoryRegion root; /* The root container of the device */
|
||||
MemoryRegion bypass_mr; /* The alias of shared memory MR */
|
||||
} IOMMUDevice;
|
||||
|
||||
typedef struct IOMMUPciBus {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue