linux/drivers/iommu/iommufd
Joao Martins e2a4b29478 iommufd: Add IOMMU_HWPT_SET_DIRTY_TRACKING
Every IOMMU driver should be able to implement the needed iommu domain ops
to control dirty tracking.

Connect a hw_pagetable to the IOMMU core dirty tracking ops, specifically
the ability to enable/disable dirty tracking on an IOMMU domain
(hw_pagetable id). To that end add an io_pagetable kernel API to toggle
dirty tracking:

* iopt_set_dirty_tracking(iopt, [domain], state)

The intended caller of this is via the hw_pagetable object that is created.

Internally it will ensure the leftover dirty state is cleared /right
before/ dirty tracking starts. This is also useful for iommu drivers which
may decide that dirty tracking is always-enabled at boot without wanting to
toggle dynamically via corresponding iommu domain op.

Link: https://lore.kernel.org/r/20231024135109.73787-7-joao.m.martins@oracle.com
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2023-10-24 11:58:43 -03:00
..
device.c iommufd: Flow user flags for domain allocation to domain_alloc_user() 2023-10-10 13:31:24 -03:00
double_span.h
hw_pagetable.c iommufd: Add IOMMU_HWPT_SET_DIRTY_TRACKING 2023-10-24 11:58:43 -03:00
io_pagetable.c iommufd: Add IOMMU_HWPT_SET_DIRTY_TRACKING 2023-10-24 11:58:43 -03:00
io_pagetable.h
ioas.c iommu/iommufd: Pass iommufd_ctx pointer in iommufd_get_ioas() 2023-03-29 16:52:41 -03:00
iommufd_private.h iommufd: Add IOMMU_HWPT_SET_DIRTY_TRACKING 2023-10-24 11:58:43 -03:00
iommufd_test.h iommufd/selftest: Add coverage for IOMMU_GET_HW_INFO ioctl 2023-08-18 12:52:15 -03:00
iova_bitmap.c iommufd/iova_bitmap: Move symbols to IOMMUFD namespace 2023-10-24 11:58:42 -03:00
Kconfig vfio: Compile vfio_group infrastructure optionally 2023-07-25 10:20:50 -06:00
main.c iommufd: Add IOMMU_HWPT_SET_DIRTY_TRACKING 2023-10-24 11:58:43 -03:00
Makefile vfio: Move iova_bitmap into iommufd 2023-10-24 11:58:42 -03:00
pages.c iommufd: Set end correctly when doing batch carry 2023-07-27 11:27:20 -03:00
selftest.c iommufd/selftest: Add domain_alloc_user() support in iommu mock 2023-10-10 13:31:24 -03:00
vfio_compat.c vfio: align capability structures 2023-08-17 12:17:44 -06:00