mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
backends/iommufd: Introduce the iommufd object
Introduce an iommufd object which allows the interaction with the host /dev/iommu device. The /dev/iommu can have been already pre-opened outside of qemu, in which case the fd can be passed directly along with the iommufd object: This allows the iommufd object to be shared accross several subsystems (VFIO, VDPA, ...). For example, libvirt would open the /dev/iommu once. If no fd is passed along with the iommufd object, the /dev/iommu is opened by the qemu code. Suggested-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Tested-by: Eric Auger <eric.auger@redhat.com> Tested-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
committed by
Cédric Le Goater
parent
dbb9d0c969
commit
6e6d8ac62b
@@ -794,6 +794,23 @@
|
||||
{ 'struct': 'VfioUserServerProperties',
|
||||
'data': { 'socket': 'SocketAddress', 'device': 'str' } }
|
||||
|
||||
##
|
||||
# @IOMMUFDProperties:
|
||||
#
|
||||
# Properties for iommufd objects.
|
||||
#
|
||||
# @fd: file descriptor name previously passed via 'getfd' command,
|
||||
# which represents a pre-opened /dev/iommu. This allows the
|
||||
# iommufd object to be shared accross several subsystems
|
||||
# (VFIO, VDPA, ...), and the file descriptor to be shared
|
||||
# with other process, e.g. DPDK. (default: QEMU opens
|
||||
# /dev/iommu by itself)
|
||||
#
|
||||
# Since: 9.0
|
||||
##
|
||||
{ 'struct': 'IOMMUFDProperties',
|
||||
'data': { '*fd': 'str' } }
|
||||
|
||||
##
|
||||
# @RngProperties:
|
||||
#
|
||||
@@ -934,6 +951,7 @@
|
||||
'input-barrier',
|
||||
{ 'name': 'input-linux',
|
||||
'if': 'CONFIG_LINUX' },
|
||||
'iommufd',
|
||||
'iothread',
|
||||
'main-loop',
|
||||
{ 'name': 'memory-backend-epc',
|
||||
@@ -1003,6 +1021,7 @@
|
||||
'input-barrier': 'InputBarrierProperties',
|
||||
'input-linux': { 'type': 'InputLinuxProperties',
|
||||
'if': 'CONFIG_LINUX' },
|
||||
'iommufd': 'IOMMUFDProperties',
|
||||
'iothread': 'IothreadProperties',
|
||||
'main-loop': 'MainLoopProperties',
|
||||
'memory-backend-epc': { 'type': 'MemoryBackendEpcProperties',
|
||||
|
||||
Reference in New Issue
Block a user