mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
vfio/iommufd: Probe and request hwpt dirty tracking capability
In preparation to using the dirty tracking UAPI, probe whether the IOMMU supports dirty tracking. This is done via the data stored in hiod::caps::hw_caps initialized from GET_HW_INFO. Qemu doesn't know if VF dirty tracking is supported when allocating hardware pagetable in iommufd_cdev_autodomains_get(). This is because VFIODevice migration state hasn't been initialized *yet* hence it can't pick between VF dirty tracking vs IOMMU dirty tracking. So, if IOMMU supports dirty tracking it always creates HWPTs with IOMMU_HWPT_ALLOC_DIRTY_TRACKING even if later on VFIOMigration decides to use VF dirty tracking instead. Signed-off-by: Joao Martins <joao.m.martins@oracle.com> [ clg: - Fixed vbasedev->iommu_dirty_tracking assignment in iommufd_cdev_autodomains_get() - Added warning for heterogeneous dirty page tracking support in iommufd_cdev_autodomains_get() ] Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
This commit is contained in:
parent
83a4d596a9
commit
dddfd8d667
2 changed files with 28 additions and 0 deletions
|
@ -97,6 +97,7 @@ typedef struct IOMMUFDBackend IOMMUFDBackend;
|
|||
|
||||
typedef struct VFIOIOASHwpt {
|
||||
uint32_t hwpt_id;
|
||||
uint32_t hwpt_flags;
|
||||
QLIST_HEAD(, VFIODevice) device_list;
|
||||
QLIST_ENTRY(VFIOIOASHwpt) next;
|
||||
} VFIOIOASHwpt;
|
||||
|
@ -139,6 +140,7 @@ typedef struct VFIODevice {
|
|||
OnOffAuto pre_copy_dirty_page_tracking;
|
||||
bool dirty_pages_supported;
|
||||
bool dirty_tracking;
|
||||
bool iommu_dirty_tracking;
|
||||
HostIOMMUDevice *hiod;
|
||||
int devid;
|
||||
IOMMUFDBackend *iommufd;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue