diff options
author | Joao Martins <[email protected]> | 2024-06-27 12:00:59 +0100 |
---|---|---|
committer | Jason Gunthorpe <[email protected]> | 2024-06-28 13:12:22 -0300 |
commit | dceb5304d7263f72333d25e5940254f98b663010 (patch) | |
tree | 3bceaf8b6d2be051635c4c6fc2a33d28d10b468a | |
parent | ffa3c799ce157493615f9f3c2b3c9ba602d320b9 (diff) |
iommufd/selftest: Do not record head iova to better match iommu drivers
Do not set a hugepage-aligned IOVA for incrementing an IOVA, to better
match current IOMMU driver implementations. Keep the logic of clearing all
IOPTE dirty bits for a whole hugepage, even if the range being dirtied
starts from part of the hugepage. This is also similar to AMD driver (iommu
v1 format) where IOMMU uses various subpage PTE data for dirty tracking
(for non-standard page sizes).
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joao Martins <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Tested-by: Matt Ochs <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
-rw-r--r-- | drivers/iommu/iommufd/selftest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iommu/iommufd/selftest.c b/drivers/iommu/iommufd/selftest.c index 654ed3339095..7a70a3e0fee6 100644 --- a/drivers/iommu/iommufd/selftest.c +++ b/drivers/iommu/iommufd/selftest.c @@ -266,8 +266,8 @@ static int mock_domain_read_and_clear_dirty(struct iommu_domain *domain, /* Clear dirty */ if (mock_test_and_clear_dirty(mock, head, pgsize, flags)) - iommu_dirty_bitmap_record(dirty, head, pgsize); - iova = head + pgsize; + iommu_dirty_bitmap_record(dirty, iova, pgsize); + iova += pgsize; } while (iova < end); return 0; |