[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/16] vfio/iommufd: Add hw_caps field to HostIOMMUDeviceCaps
From: |
Cédric Le Goater |
Subject: |
[PULL 10/16] vfio/iommufd: Add hw_caps field to HostIOMMUDeviceCaps |
Date: |
Tue, 23 Jul 2024 16:00:13 +0200 |
From: Joao Martins <joao.m.martins@oracle.com>
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: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
---
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
d1c10ff7c239d9a0ae31894abe929e1e96b63ef2..809cced4ba5c56263132b474a382e4bd0ffdd3cd
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
f1e7cf3e9cafde08a0353876da973f3713006df3..fb87e64e443035bc239f4f4272ae1c28fa8ab8c9
100644
--- a/hw/vfio/iommufd.c
+++ b/hw/vfio/iommufd.c
@@ -725,6 +725,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;
}
--
2.45.2
- [PULL 00/16] vfio queue, Cédric Le Goater, 2024/07/23
- [PULL 01/16] hw/vfio/container: Fix SIGSEV on vfio_container_instance_finalize(), Cédric Le Goater, 2024/07/23
- [PULL 02/16] vfio/pci: Extract mdev check into an helper, Cédric Le Goater, 2024/07/23
- [PULL 04/16] backends/iommufd: Extend iommufd_backend_get_device_info() to fetch HW capabilities, Cédric Le Goater, 2024/07/23
- [PULL 03/16] vfio/iommufd: Don't initialize nor set a HOST_IOMMU_DEVICE with mdev, Cédric Le Goater, 2024/07/23
- [PULL 05/16] vfio/iommufd: Return errno in iommufd_cdev_attach_ioas_hwpt(), Cédric Le Goater, 2024/07/23
- [PULL 06/16] vfio/ap: Don't initialize HOST_IOMMU_DEVICE with mdev, Cédric Le Goater, 2024/07/23
- [PULL 07/16] vfio/ccw: Don't initialize HOST_IOMMU_DEVICE with mdev, Cédric Le Goater, 2024/07/23
- [PULL 08/16] vfio/iommufd: Introduce auto domain creation, Cédric Le Goater, 2024/07/23
- [PULL 09/16] vfio/{iommufd,container}: Remove caps::aw_bits, Cédric Le Goater, 2024/07/23
- [PULL 10/16] vfio/iommufd: Add hw_caps field to HostIOMMUDeviceCaps,
Cédric Le Goater <=
- [PULL 12/16] vfio/iommufd: Probe and request hwpt dirty tracking capability, Cédric Le Goater, 2024/07/23
- [PULL 11/16] vfio/{iommufd, container}: Invoke HostIOMMUDevice::realize() during attach_device(), Cédric Le Goater, 2024/07/23
- [PULL 13/16] vfio/iommufd: Implement VFIOIOMMUClass::set_dirty_tracking support, Cédric Le Goater, 2024/07/23
- Re: [PULL 00/16] vfio queue, Cédric Le Goater, 2024/07/23