[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH rfcv2 07/18] vfio/container: Implement host_iommu_device_init
From: |
Eric Auger |
Subject: |
Re: [PATCH rfcv2 07/18] vfio/container: Implement host_iommu_device_init callback in legacy mode |
Date: |
Mon, 19 Feb 2024 18:13:52 +0100 |
User-agent: |
Mozilla Thunderbird |
Hi Zhenzhong,
On 2/1/24 08:28, Zhenzhong Duan wrote:
> This callback will be used to initialize base and public elements
> in IOMMULegacyDevice.
>
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
> hw/vfio/container.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/hw/vfio/container.c b/hw/vfio/container.c
> index bd25b9fbad..8fafd4b4e5 100644
> --- a/hw/vfio/container.c
> +++ b/hw/vfio/container.c
> @@ -1120,6 +1120,12 @@ out_single:
> return ret;
> }
>
> +static void vfio_legacy_host_iommu_device_init(VFIODevice *vbasedev)
> +{
> + host_iommu_base_device_init(&vbasedev->base_hdev, HID_LEGACY,
> + sizeof(IOMMULegacyDevice));
To me this should allocate a new
IOMMULegacyDevice and set the VFIODevice base_hdev handle to its base @
Thanks
Eric
> +}
> +
> static void vfio_iommu_legacy_class_init(ObjectClass *klass, void *data)
> {
> VFIOIOMMUClass *vioc = VFIO_IOMMU_CLASS(klass);
> @@ -1132,6 +1138,7 @@ static void vfio_iommu_legacy_class_init(ObjectClass
> *klass, void *data)
> vioc->set_dirty_page_tracking = vfio_legacy_set_dirty_page_tracking;
> vioc->query_dirty_bitmap = vfio_legacy_query_dirty_bitmap;
> vioc->pci_hot_reset = vfio_legacy_pci_hot_reset;
> + vioc->host_iommu_device_init = vfio_legacy_host_iommu_device_init;
> };
>
> static const TypeInfo types[] = {
- [PATCH rfcv2 01/18] Introduce a common abstract struct HostIOMMUDevice, (continued)
- [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
- Re: [PATCH rfcv2 07/18] vfio/container: Implement host_iommu_device_init callback in legacy mode,
Eric Auger <=
- [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
- [PATCH rfcv2 10/18] hw/pci: Introduce pci_device_set/unset_iommu_device(), Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 12/18] vfio: Initialize host IOMMU device and pass to vIOMMU, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 11/18] intel_iommu: Add set/unset_iommu_device callback, Zhenzhong Duan, 2024/02/01