Skip to content

Commit 698be93

Browse files
committed
iommufd/selftest: Do not record head iova to better match iommu drivers
JIRA: https://issues.redhat.com/browse/RHEL-40162 Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git commit dceb530 Author: Joao Martins <joao.m.martins@oracle.com> Date: Thu Jun 27 12:00:59 2024 +0100 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/20240627110105.62325-6-joao.m.martins@oracle.com Signed-off-by: Joao Martins <joao.m.martins@oracle.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Tested-by: Matt Ochs <mochs@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> (cherry picked from commit dceb530) Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
1 parent 15a579d commit 698be93

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)