]> git.proxmox.com Git - mirror_qemu.git/commit
vfio/platform: Allow the selection of a given iommu backend
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Tue, 21 Nov 2023 08:44:11 +0000 (16:44 +0800)
committerCédric Le Goater <clg@redhat.com>
Tue, 19 Dec 2023 18:03:38 +0000 (19:03 +0100)
commita6c50e1c3f8d0eb77edaea392e61508bb3c516f8
tree9665b05cd63ba1f67e7f6f3ffc3b74302d95b812
parentda3e04b26fd8d15b344944504d5ffa9c5f20b54b
vfio/platform: Allow the selection of a given iommu backend

Now we support two types of iommu backends, let's add the capability
to select one of them. This depends on whether an iommufd object has
been linked with the vfio-platform device:

If the user wants to use the legacy backend, it shall not
link the vfio-platform device with any iommufd object:

 -device vfio-platform,host=XXX

This is called the legacy mode/backend.

If the user wants to use the iommufd backend (/dev/iommu) it
shall pass an iommufd object id in the vfio-platform device options:

 -object iommufd,id=iommufd0
 -device vfio-platform,host=XXX,iommufd=iommufd0

Suggested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/platform.c