]> Gentwo Git Trees - linux/.git/commit
iommupt: Add read_and_clear_dirty op
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 4 Nov 2025 18:30:06 +0000 (14:30 -0400)
committerJoerg Roedel <joerg.roedel@amd.com>
Wed, 5 Nov 2025 08:07:11 +0000 (09:07 +0100)
commit4a00f943489103b4b9edff9f39bd484efbfb15fa
tree0831d6a00413ac44214c4c0c370877a8cbe12cd8
parentdcd6a011a8d523a114af2360a8753de5bd60c139
iommupt: Add read_and_clear_dirty op

IOMMU HW now supports updating a dirty bit in an entry when a DMA writes
to the entry's VA range. iommufd has a uAPI to read and clear the dirty
bits from the tables.

This is a trivial recursive descent algorithm to read and optionally clear
the dirty bits. The format needs a function to tell if a contiguous entry
is dirty, and a function to clear a contiguous entry back to clean.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Samiullah Khawaja <skhawaja@google.com>
Tested-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Tested-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/generic_pt/iommu_pt.h
include/linux/generic_pt/iommu.h