[vfio-users] How does a vfio container related to a iommu_domain

Alex Williamson alex.williamson at redhat.com
Fri May 25 16:52:44 UTC 2018


On Fri, 25 May 2018 08:44:05 +0000
"Wuzongyong (Euler Dept)" <cordius.wu at huawei.com> wrote:

> Hi,
> 
> I noted that the comments in vfio_iommu_type1_attach_group:
>                 /*
>                 * Try to match an existing compatible domain.  We don't want to
>                 * preclude an IOMMU driver supporting multiple bus_types and being
>                 * able to include different bus_types in the same IOMMU domain, so
>                 * we test whether the domains use the same iommu_ops rather than
>                 * testing if they're on the same bus_type.
>                 */
> 
> In intel x86 platforms currently, can I think a virtual machine have a one-to-one association with  a vfio container,
> and a vfio container have a one-to-one association with a iommu_domain?.

Until we start adding vIOMMUs to the VM configuration, yes, all
assigned devices for a VM instance are typically within a single
container which usually has a 1:1 association to an iommu_domain.  A
vfio container represents a single IOMMU context, so as long as all the
devices in the VM can only exists in a single address space within that
VM, they're in the same container.  A vIOMMU introduces a per-device
address space within the VM.

> Does there exist any scene or system that two domains use two different iommu_ops?

It is possible, but largely theoretical for x86.  It's possible if you
look at vfio-platform in combination with vfio-pci, which is more
likely to be seen on ARM platforms.  Thanks,

Alex




More information about the vfio-users mailing list