[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 3/9] vfio/iommufd: Add hw_caps field to HostIOMMUDeviceCap
From: |
Eric Auger |
Subject: |
Re: [PATCH v6 3/9] vfio/iommufd: Add hw_caps field to HostIOMMUDeviceCaps |
Date: |
Tue, 23 Jul 2024 09:26:41 +0200 |
User-agent: |
Mozilla Thunderbird |
On 7/22/24 23:13, Joao Martins wrote:
> Store the value of @caps returned by iommufd_backend_get_device_info()
> in a new field HostIOMMUDeviceCaps::hw_caps. Right now the only value is
> whether device IOMMU supports dirty tracking (IOMMU_HW_CAP_DIRTY_TRACKING).
>
> This is in preparation for HostIOMMUDevice::realize() being called early
> during attach_device().
>
> Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
> Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric
> ---
> include/sysemu/host_iommu_device.h | 4 ++++
> hw/vfio/iommufd.c | 1 +
> 2 files changed, 5 insertions(+)
>
> diff --git a/include/sysemu/host_iommu_device.h
> b/include/sysemu/host_iommu_device.h
> index d1c10ff7c239..809cced4ba5c 100644
> --- a/include/sysemu/host_iommu_device.h
> +++ b/include/sysemu/host_iommu_device.h
> @@ -19,9 +19,13 @@
> * struct HostIOMMUDeviceCaps - Define host IOMMU device capabilities.
> *
> * @type: host platform IOMMU type.
> + *
> + * @hw_caps: host platform IOMMU capabilities (e.g. on IOMMUFD this
> represents
> + * the @out_capabilities value returned from IOMMU_GET_HW_INFO
> ioctl)
> */
> typedef struct HostIOMMUDeviceCaps {
> uint32_t type;
> + uint64_t hw_caps;
> } HostIOMMUDeviceCaps;
>
> #define TYPE_HOST_IOMMU_DEVICE "host-iommu-device"
> diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
> index 5bb623879abe..5e2fc1ce089d 100644
> --- a/hw/vfio/iommufd.c
> +++ b/hw/vfio/iommufd.c
> @@ -724,6 +724,7 @@ static bool hiod_iommufd_vfio_realize(HostIOMMUDevice
> *hiod, void *opaque,
>
> hiod->name = g_strdup(vdev->name);
> caps->type = type;
> + caps->hw_caps = hw_caps;
>
> return true;
> }
[PATCH v6 6/9] vfio/iommufd: Implement VFIOIOMMUClass::set_dirty_tracking support, Joao Martins, 2024/07/22
[PATCH v6 3/9] vfio/iommufd: Add hw_caps field to HostIOMMUDeviceCaps, Joao Martins, 2024/07/22
[PATCH v6 8/9] vfio/migration: Don't block migration device dirty tracking is unsupported, Joao Martins, 2024/07/22
[PATCH v6 9/9] vfio/common: Allow disabling device dirty page tracking, Joao Martins, 2024/07/22
Re: [PATCH v6 0/9] hw/iommufd: IOMMUFD Dirty Tracking, Cédric Le Goater, 2024/07/23