iommufd/selftest: Test IOMMU_HWPT_ALLOC_DIRTY_TRACKING
authorJoao Martins <joao.m.martins@oracle.com>
Tue, 24 Oct 2023 13:51:05 +0000 (14:51 +0100)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 24 Oct 2023 14:58:44 +0000 (11:58 -0300)
commit266ce58989ba05e2a24460fdbf402d766c2e3870
tree306f83d46769f067ff1962e07ee46df8a2a55530
parente04b23c8d4ed977dbab4a4159f9e4d9a878b5c65
iommufd/selftest: Test IOMMU_HWPT_ALLOC_DIRTY_TRACKING

In order to selftest the iommu domain dirty enforcing implement the
mock_domain necessary support and add a new dev_flags to test that the
hwpt_alloc/attach_device fails as expected.

Expand the existing mock_domain fixture with a enforce_dirty test that
exercises the hwpt_alloc and device attachment.

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