diff options
author | Eric Auger <eric.auger@redhat.com> | 2024-07-01 10:48:56 +0200 |
---|---|---|
committer | Cédric Le Goater <clg@redhat.com> | 2024-07-09 11:50:37 +0200 |
commit | 8fe0ebe15d7775be72b1aaceb7405b68d3ec6368 (patch) | |
tree | dc1cd40914bd7bc4e539d6c74b9000b121e08da4 /hw | |
parent | d59ca1ca17480fc776aa02bf536ca3c87dc79323 (diff) | |
download | qemu-8fe0ebe15d7775be72b1aaceb7405b68d3ec6368.zip qemu-8fe0ebe15d7775be72b1aaceb7405b68d3ec6368.tar.gz qemu-8fe0ebe15d7775be72b1aaceb7405b68d3ec6368.tar.bz2 |
HostIOMMUDevice: Introduce get_page_size_mask() callback
This callback will be used to retrieve the page size mask supported
along a given Host IOMMU device.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/vfio/container.c | 10 | ||||
-rw-r--r-- | hw/vfio/iommufd.c | 11 |
2 files changed, 21 insertions, 0 deletions
diff --git a/hw/vfio/container.c b/hw/vfio/container.c index ddd8359..425db1a 100644 --- a/hw/vfio/container.c +++ b/hw/vfio/container.c @@ -1173,6 +1173,15 @@ hiod_legacy_vfio_get_iova_ranges(HostIOMMUDevice *hiod) return vfio_container_get_iova_ranges(vdev->bcontainer); } +static uint64_t +hiod_legacy_vfio_get_page_size_mask(HostIOMMUDevice *hiod) +{ + VFIODevice *vdev = hiod->agent; + + g_assert(vdev); + return vfio_container_get_page_size_mask(vdev->bcontainer); +} + static void vfio_iommu_legacy_instance_init(Object *obj) { VFIOContainer *container = VFIO_IOMMU_LEGACY(obj); @@ -1187,6 +1196,7 @@ static void hiod_legacy_vfio_class_init(ObjectClass *oc, void *data) hioc->realize = hiod_legacy_vfio_realize; hioc->get_cap = hiod_legacy_vfio_get_cap; hioc->get_iova_ranges = hiod_legacy_vfio_get_iova_ranges; + hioc->get_page_size_mask = hiod_legacy_vfio_get_page_size_mask; }; static const TypeInfo types[] = { diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index 211e722..7b5f87a 100644 --- a/hw/vfio/iommufd.c +++ b/hw/vfio/iommufd.c @@ -652,12 +652,23 @@ hiod_iommufd_vfio_get_iova_ranges(HostIOMMUDevice *hiod) return vfio_container_get_iova_ranges(vdev->bcontainer); } +static uint64_t +hiod_iommufd_vfio_get_page_size_mask(HostIOMMUDevice *hiod) +{ + VFIODevice *vdev = hiod->agent; + + g_assert(vdev); + return vfio_container_get_page_size_mask(vdev->bcontainer); +} + + static void hiod_iommufd_vfio_class_init(ObjectClass *oc, void *data) { HostIOMMUDeviceClass *hiodc = HOST_IOMMU_DEVICE_CLASS(oc); hiodc->realize = hiod_iommufd_vfio_realize; hiodc->get_iova_ranges = hiod_iommufd_vfio_get_iova_ranges; + hiodc->get_page_size_mask = hiod_iommufd_vfio_get_page_size_mask; }; static const TypeInfo types[] = { |