[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH rfcv2 04/18] vfio: Add host iommu device instance into VFIODe
From: |
Eric Auger |
Subject: |
Re: [PATCH rfcv2 04/18] vfio: Add host iommu device instance into VFIODevice |
Date: |
Mon, 19 Feb 2024 16:34:37 +0100 |
User-agent: |
Mozilla Thunderbird |
Hi Zhenzhong,
On 2/1/24 08:28, Zhenzhong Duan wrote:
> Either IOMMULegacyDevice or IOMMUFDDevice into VFIODevice, neither
> both.
>
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
> include/hw/vfio/vfio-common.h | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
> index 8bfb9cbe94..1bbad003ee 100644
> --- a/include/hw/vfio/vfio-common.h
> +++ b/include/hw/vfio/vfio-common.h
> @@ -32,6 +32,7 @@
> #include "sysemu/sysemu.h"
> #include "hw/vfio/vfio-container-base.h"
> #include "sysemu/host_iommu_device.h"
> +#include "sysemu/iommufd.h"
>
> #define VFIO_MSG_PREFIX "vfio %s: "
>
> @@ -132,8 +133,18 @@ typedef struct VFIODevice {
> bool dirty_tracking;
> int devid;
> IOMMUFDBackend *iommufd;
> + union {
> + HostIOMMUDevice base_hdev;
I don't think we want the base object above to be usable here
Thanks
Eric
> + IOMMULegacyDevice legacy_dev;
> + IOMMUFDDevice iommufd_dev;
> + };
> } VFIODevice;
>
> +QEMU_BUILD_BUG_ON(offsetof(VFIODevice, legacy_dev.base) !=
> + offsetof(VFIODevice, base_hdev));
> +QEMU_BUILD_BUG_ON(offsetof(VFIODevice, iommufd_dev.base) !=
> + offsetof(VFIODevice, base_hdev));
> +
> struct VFIODeviceOps {
> void (*vfio_compute_needs_reset)(VFIODevice *vdev);
> int (*vfio_hot_reset_multi)(VFIODevice *vdev);
- [PATCH rfcv2 00/18] Check and sync host IOMMU cap/ecap with vIOMMU, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 01/18] Introduce a common abstract struct HostIOMMUDevice, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 02/18] backends/iommufd: Introduce IOMMUFDDevice, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 04/18] vfio: Add host iommu device instance into VFIODevice, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 03/18] vfio: Introduce IOMMULegacyDevice, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 05/18] vfio: Remove redundant iommufd and devid elements in VFIODevice, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 06/18] vfio: Introduce host_iommu_device_init callback, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 07/18] vfio/container: Implement host_iommu_device_init callback in legacy mode, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 08/18] vfio/iommufd: Implement host_iommu_device_init callback in iommufd mode, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 09/18] vfio/pci: Initialize host iommu device instance after attachment, Zhenzhong Duan, 2024/02/01