]> www.infradead.org Git - users/dwmw2/linux.git/commit
iommu/io-pgtable-arm: Add read_and_clear_dirty() support
authorShameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Wed, 3 Jul 2024 10:16:02 +0000 (11:16 +0100)
committerWill Deacon <will@kernel.org>
Wed, 3 Jul 2024 14:45:47 +0000 (15:45 +0100)
commit4fe88fd8b4aecb7f9680bf898811db76b94095a9
treef581d96845ccebfcdaabc979b94e933b8046f076
parent2f8d6178b4fe3e2f50782fa640921a9ee46b6d6f
iommu/io-pgtable-arm: Add read_and_clear_dirty() support

.read_and_clear_dirty() IOMMU domain op takes care of reading the dirty
bits (i.e. PTE has DBM set and AP[2] clear) and marshalling into a
bitmap of a given page size.

While reading the dirty bits we also set the PTE AP[2] bit to mark it
as writeable-clean depending on read_and_clear_dirty() flags.

PTE states with respect to DBM bit:

                       DBM bit        AP[2]("RDONLY" bit)
1. writable_clean        1                 1
2. writable_dirty        1                 0
3. read-only             0                 1

Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Link: https://lore.kernel.org/r/20240703101604.2576-4-shameerali.kolothum.thodi@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/io-pgtable-arm.c