Skip to content

Commit dceb530

Browse files
jpemartinsjgunthorpe
authored andcommitted
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]>
1 parent ffa3c79 commit dceb530

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iommu/iommufd/selftest.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ static int mock_domain_read_and_clear_dirty(struct iommu_domain *domain,
266266

267267
/* Clear dirty */
268268
if (mock_test_and_clear_dirty(mock, head, pgsize, flags))
269-
iommu_dirty_bitmap_record(dirty, head, pgsize);
270-
iova = head + pgsize;
269+
iommu_dirty_bitmap_record(dirty, iova, pgsize);
270+
iova += pgsize;
271271
} while (iova < end);
272272

273273
return 0;

0 commit comments

Comments
 (0)