diff options
author | Zhenzhong Duan <zhenzhong.duan@intel.com> | 2024-06-05 16:30:32 +0800 |
---|---|---|
committer | Cédric Le Goater <clg@redhat.com> | 2024-06-24 23:15:30 +0200 |
commit | d441e05e26033eb0e49c4185293424a480ef750f (patch) | |
tree | 161736c20c432f0cb75030d3128867d4571706dc /include/hw/vfio | |
parent | 6f274444c579305d14d355bab24af31ea2bef224 (diff) | |
download | qemu-d441e05e26033eb0e49c4185293424a480ef750f.zip qemu-d441e05e26033eb0e49c4185293424a480ef750f.tar.gz qemu-d441e05e26033eb0e49c4185293424a480ef750f.tar.bz2 |
vfio/container: Implement HostIOMMUDeviceClass::realize() handler
The realize function populates the capabilities. For now only the
aw_bits caps is computed for legacy backend.
Introduce a helper function vfio_device_get_aw_bits() which calls
range_get_last_bit() to get host aw_bits and package it in
HostIOMMUDeviceCaps for query with .get_cap(). This helper will
also be used by iommufd backend.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/vfio')
-rw-r--r-- | include/hw/vfio/vfio-common.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index 56d1717..105b8b7 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -289,4 +289,5 @@ bool vfio_device_get_name(VFIODevice *vbasedev, Error **errp); void vfio_device_set_fd(VFIODevice *vbasedev, const char *str, Error **errp); void vfio_device_init(VFIODevice *vbasedev, int type, VFIODeviceOps *ops, DeviceState *dev, bool ram_discard); +int vfio_device_get_aw_bits(VFIODevice *vdev); #endif /* HW_VFIO_VFIO_COMMON_H */ |