> From: Joao Martins <joao.m.martins@xxxxxxxxxx> > Sent: Thursday, October 19, 2023 4:27 AM > > Add to iommu domain operations a set of callbacks to perform dirty > tracking, particulary to start and stop tracking and to read and clear the > dirty data. > > Drivers are generally expected to dynamically change its translation > structures to toggle the tracking and flush some form of control state > structure that stands in the IOVA translation path. Though it's not > mandatory, as drivers can also enable dirty tracking at boot, and just > clear the dirty bits before setting dirty tracking. For each of the newly > added IOMMU core APIs: > > iommu_cap::IOMMU_CAP_DIRTY: new device iommu_capable value when > probing for > capabilities of the device. IOMMU_CAP_DIRTY_TRACKING is more readable. > @@ -671,6 +724,9 @@ struct iommu_fwspec { > /* ATS is supported */ > #define IOMMU_FWSPEC_PCI_RC_ATS (1 << 0) > > +/* Read but do not clear any dirty bits */ > +#define IOMMU_DIRTY_NO_CLEAR (1 << 0) > + better move to the place where iommu_dirty_ops is defined. Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>