[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 17/27] backends/iommufd: Introduce the iommufd object
|
From: |
Markus Armbruster |
|
Subject: |
Re: [PATCH v2 17/27] backends/iommufd: Introduce the iommufd object |
|
Date: |
Mon, 16 Oct 2023 12:00:49 +0200 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Zhenzhong Duan <zhenzhong.duan@intel.com> writes:
> From: Eric Auger <eric.auger@redhat.com>
>
> 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.
>
> The CONFIG_IOMMUFD option must be set to compile this new object.
>
> 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>
> ---
> MAINTAINERS | 7 +
> qapi/qom.json | 18 ++-
> include/sysemu/iommufd.h | 46 +++++++
> backends/iommufd-stub.c | 59 +++++++++
> backends/iommufd.c | 268 +++++++++++++++++++++++++++++++++++++++
> backends/Kconfig | 4 +
> backends/meson.build | 5 +
> backends/trace-events | 12 ++
> qemu-options.hx | 13 ++
> 9 files changed, 431 insertions(+), 1 deletion(-)
> create mode 100644 include/sysemu/iommufd.h
> create mode 100644 backends/iommufd-stub.c
> create mode 100644 backends/iommufd.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 9e7dec4a58..a7cdeb7825 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2081,6 +2081,13 @@ F: hw/vfio/ap.c
> F: docs/system/s390x/vfio-ap.rst
> L: qemu-s390x@nongnu.org
>
> +iommufd
> +M: Yi Liu <yi.l.liu@intel.com>
> +M: Eric Auger <eric.auger@redhat.com>
> +S: Supported
> +F: backends/iommufd.c
> +F: include/sysemu/iommufd.h
> +
> vhost
> M: Michael S. Tsirkin <mst@redhat.com>
> S: Supported
> diff --git a/qapi/qom.json b/qapi/qom.json
> index c53ef978ff..3f964e57f5 100644
> --- a/qapi/qom.json
> +++ b/qapi/qom.json
> @@ -794,6 +794,18 @@
> { 'struct': 'VfioUserServerProperties',
> 'data': { 'socket': 'SocketAddress', 'device': 'str' } }
>
> +##
> +# @IOMMUFDProperties:
> +#
> +# Properties for IOMMUFDbackend objects.
This is the only occurence of "IOMMUFDbackend". Do you mean iommufd?
> +#
> +# fd: file descriptor name
Awfully terse. Like many existing FOOProperties. Would it make sense
to document what objects of type iommufd are good for, and how they use
@fd? Or is it already documented elsewhere?
> +#
> +# Since: 7.2
Since: 8.2.
> +##
> +{ 'struct': 'IOMMUFDProperties',
> + 'data': { '*fd': 'str' } }
> +
> ##
> # @RngProperties:
> #
> @@ -948,6 +960,8 @@
> 'qtest',
> 'rng-builtin',
> 'rng-egd',
> + { 'name': 'iommufd',
> + 'if': 'CONFIG_IOMMUFD' },
> { 'name': 'rng-random',
> 'if': 'CONFIG_POSIX' },
> 'secret',
Please keep the members sorted.
> @@ -1029,7 +1043,9 @@
> 'tls-creds-x509': 'TlsCredsX509Properties',
> 'tls-cipher-suites': 'TlsCredsProperties',
> 'x-remote-object': 'RemoteObjectProperties',
> - 'x-vfio-user-server': 'VfioUserServerProperties'
> + 'x-vfio-user-server': 'VfioUserServerProperties',
> + 'iommufd': { 'type': 'IOMMUFDProperties',
> + 'if': 'CONFIG_IOMMUFD' }
Likewise.
> } }
>
> ##
[...]
- [PATCH v2 08/27] vfio/container: Move hostwin_list in base container, (continued)
- [PATCH v2 08/27] vfio/container: Move hostwin_list in base container, Zhenzhong Duan, 2023/10/16
- [PATCH v2 09/27] vfio/container: Switch to IOMMU BE set_dirty_page_tracking/query_dirty_bitmap API, Zhenzhong Duan, 2023/10/16
- [PATCH v2 10/27] vfio/container: Move per container device list in base container, Zhenzhong Duan, 2023/10/16
- [PATCH v2 11/27] vfio/container: Convert functions to base container, Zhenzhong Duan, 2023/10/16
- [PATCH v2 12/27] vfio/container: Move vrdl_list, pgsizes and dma_max_mappings to base container, Zhenzhong Duan, 2023/10/16
- [PATCH v2 13/27] vfio/container: Move listener to base container, Zhenzhong Duan, 2023/10/16
- [PATCH v2 14/27] vfio/container: Move dirty_pgsizes and max_dirty_bitmap_size to base container, Zhenzhong Duan, 2023/10/16
- [PATCH v2 15/27] vfio/container: Implement attach/detach_device, Zhenzhong Duan, 2023/10/16
- [PATCH v2 16/27] Add iommufd configure option, Zhenzhong Duan, 2023/10/16
- [PATCH v2 17/27] backends/iommufd: Introduce the iommufd object, Zhenzhong Duan, 2023/10/16
- Re: [PATCH v2 17/27] backends/iommufd: Introduce the iommufd object,
Markus Armbruster <=
- [PATCH v2 18/27] util/char_dev: Add open_cdev(), Zhenzhong Duan, 2023/10/16
- [PATCH v2 19/27] vfio/iommufd: Implement the iommufd backend, Zhenzhong Duan, 2023/10/16
- [PATCH v2 20/27] vfio/container: Bypass EEH if iommufd backend, Zhenzhong Duan, 2023/10/16
- [PATCH v2 21/27] vfio/pci: Adapt vfio pci hot reset support with iommufd BE, Zhenzhong Duan, 2023/10/16
- [PATCH v2 22/27] vfio/pci: Allow the selection of a given iommu backend, Zhenzhong Duan, 2023/10/16
- [PATCH v2 23/27] vfio/pci: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/10/16
- [PATCH v2 25/27] vfio/platform: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/10/16
- [PATCH v2 24/27] vfio: Allow the selection of a given iommu backend for platform ap and ccw, Zhenzhong Duan, 2023/10/16
- [PATCH v2 27/27] vfio/ccw: Make vfio cdev pre-openable by passing a file handle, Zhenzhong Duan, 2023/10/16