diff options
Diffstat (limited to 'hw/vfio')
| -rw-r--r-- | hw/vfio/common.c | 1 | ||||
| -rw-r--r-- | hw/vfio/container.c | 1 | ||||
| -rw-r--r-- | hw/vfio/helpers.c | 1 | ||||
| -rw-r--r-- | hw/vfio/pci.c | 1 | ||||
| -rw-r--r-- | hw/vfio/region.c | 1 | ||||
| -rw-r--r-- | hw/vfio/vfio-helpers.h | 26 |
6 files changed, 31 insertions, 0 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c index c099d4d24d..18e5aacbd1 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -44,6 +44,7 @@ #include "system/tcg.h" #include "system/tpm.h" #include "vfio-migration-internal.h" +#include "vfio-helpers.h" VFIODeviceList vfio_device_list = QLIST_HEAD_INITIALIZER(vfio_device_list); diff --git a/hw/vfio/container.c b/hw/vfio/container.c index 6ef53ee187..b2d72f5036 100644 --- a/hw/vfio/container.c +++ b/hw/vfio/container.c @@ -33,6 +33,7 @@ #include "qapi/error.h" #include "pci.h" #include "hw/vfio/vfio-container.h" +#include "vfio-helpers.h" #define TYPE_HOST_IOMMU_DEVICE_LEGACY_VFIO TYPE_HOST_IOMMU_DEVICE "-legacy-vfio" diff --git a/hw/vfio/helpers.c b/hw/vfio/helpers.c index 89403943a7..054ee6e31e 100644 --- a/hw/vfio/helpers.c +++ b/hw/vfio/helpers.c @@ -30,6 +30,7 @@ #include "qemu/error-report.h" #include "qemu/units.h" #include "monitor/monitor.h" +#include "vfio-helpers.h" /* * Common VFIO interrupt disable diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index b0aac2f3a0..bade3b80d7 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -45,6 +45,7 @@ #include "migration/qemu-file.h" #include "system/iommufd.h" #include "vfio-migration-internal.h" +#include "vfio-helpers.h" #define TYPE_VFIO_PCI_NOHOTPLUG "vfio-pci-nohotplug" diff --git a/hw/vfio/region.c b/hw/vfio/region.c index 08cd69e704..9049143abf 100644 --- a/hw/vfio/region.c +++ b/hw/vfio/region.c @@ -29,6 +29,7 @@ #include "qemu/error-report.h" #include "qemu/units.h" #include "monitor/monitor.h" +#include "vfio-helpers.h" /* * IO Port/MMIO - Beware of the endians, VFIO is always little endian diff --git a/hw/vfio/vfio-helpers.h b/hw/vfio/vfio-helpers.h new file mode 100644 index 0000000000..d7e4dcba51 --- /dev/null +++ b/hw/vfio/vfio-helpers.h @@ -0,0 +1,26 @@ +/* + * VFIO helpers + * + * Copyright Red Hat, Inc. 2025 + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef HW_VFIO_VFIO_HELPERS_H +#define HW_VFIO_VFIO_HELPERS_H + +#ifdef CONFIG_LINUX +#include <linux/vfio.h> + +struct vfio_info_cap_header * +vfio_get_cap(void *ptr, uint32_t cap_offset, uint16_t id); +struct vfio_info_cap_header * +vfio_get_device_info_cap(struct vfio_device_info *info, uint16_t id); +struct vfio_info_cap_header * +vfio_get_region_info_cap(struct vfio_region_info *info, uint16_t id); + +#endif + +int vfio_bitmap_alloc(VFIOBitmap *vbmap, hwaddr size); + +#endif /* HW_VFIO_VFIO_HELPERS_H */ |