]> xenbits.xensource.com Git - qemu-xen.git/commit
vfio/iommufd: Probe and request hwpt dirty tracking capability
authorJoao Martins <joao.m.martins@oracle.com>
Mon, 22 Jul 2024 21:13:22 +0000 (22:13 +0100)
committerCédric Le Goater <clg@redhat.com>
Tue, 23 Jul 2024 15:14:52 +0000 (17:14 +0200)
commitdddfd8d6670d2d63b851b0c976c3ae08592f4339
tree329b4c699ab3d5478fea00dc32b20399d2efe9f1
parent83a4d596a93bc22ace521789979f5ccdcd91ab96
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>
hw/vfio/iommufd.c
include/hw/vfio/vfio-common.h