| 1 | /* |
| 2 | * VFIO container |
| 3 | * |
| 4 | * Copyright Red Hat, Inc. 2025 |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 7 | */ |
| 8 | |
| 9 | #ifndef HW_VFIO_CONTAINER_LEGACY_H |
| 10 | #define HW_VFIO_CONTAINER_LEGACY_H |
| 11 | |
| 12 | #include "hw/vfio/vfio-container.h" |
| 13 | #include "hw/vfio/vfio-cpr.h" |
| 14 | |
| 15 | OBJECT_DECLARE_SIMPLE_TYPE(VFIOLegacyContainer, VFIO_IOMMU_LEGACY); |
| 16 | |
| 17 | typedef struct VFIODevice VFIODevice; |
| 18 | |
| 19 | typedef struct VFIOGroup { |
| 20 | int fd; |
| 21 | int groupid; |
| 22 | VFIOLegacyContainer *container; |
| 23 | QLIST_HEAD(, VFIODevice) device_list; |
| 24 | QLIST_ENTRY(VFIOGroup) next; |
| 25 | QLIST_ENTRY(VFIOGroup) container_next; |
| 26 | bool ram_block_discard_allowed; |
| 27 | } VFIOGroup; |
| 28 | |
| 29 | struct VFIOLegacyContainer { |
| 30 | VFIOContainer parent_obj; |
| 31 | |
| 32 | int fd; /* /dev/vfio/vfio, empowered by the attached groups */ |
| 33 | unsigned iommu_type; |
| 34 | bool unmap_all_supported; |
| 35 | QLIST_HEAD(, VFIOGroup) group_list; |
| 36 | VFIOContainerCPR cpr; |
| 37 | }; |
| 38 | |
| 39 | #endif /* HW_VFIO_CONTAINER_LEGACY_H */ |