]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP
authorJoao Martins <joao.m.martins@oracle.com>
Tue, 24 Oct 2023 13:51:07 +0000 (14:51 +0100)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 24 Oct 2023 14:58:44 +0000 (11:58 -0300)
commita9af47e382a4d517685cb13c780272e7f300ebc5
treed02d2a8a0b0e0195a398b8064399f7fbc9574adc
parent7adf267d66d1d737ea8318976fd1ce93733fd3a4
iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP

Add a new test ioctl for simulating the dirty IOVAs in the mock domain, and
implement the mock iommu domain ops that get the dirty tracking supported.

The selftest exercises the usual main workflow of:

1) Setting dirty tracking from the iommu domain
2) Read and clear dirty IOPTEs

Different fixtures will test different IOVA range sizes, that exercise
corner cases of the bitmaps.

Link: https://lore.kernel.org/r/20231024135109.73787-17-joao.m.martins@oracle.com
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/iommufd_test.h
drivers/iommu/iommufd/selftest.c
tools/testing/selftests/iommu/iommufd.c
tools/testing/selftests/iommu/iommufd_utils.h