diff options
author | 2023-10-24 14:51:05 +0100 | |
---|---|---|
committer | 2023-10-24 11:58:44 -0300 | |
commit | 266ce58989ba05e2a24460fdbf402d766c2e3870 (patch) | |
tree | 306f83d46769f067ff1962e07ee46df8a2a55530 /tools/testing/selftests/iommu/iommufd_utils.h | |
parent | iommufd/selftest: Expand mock_domain with dev_flags (diff) | |
download | linux-266ce58989ba05e2a24460fdbf402d766c2e3870.tar.gz linux-266ce58989ba05e2a24460fdbf402d766c2e3870.tar.bz2 linux-266ce58989ba05e2a24460fdbf402d766c2e3870.zip |
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>
Diffstat (limited to 'tools/testing/selftests/iommu/iommufd_utils.h')
-rw-r--r-- | tools/testing/selftests/iommu/iommufd_utils.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/iommu/iommufd_utils.h b/tools/testing/selftests/iommu/iommufd_utils.h index 1e0736adc991..4ddafa29e638 100644 --- a/tools/testing/selftests/iommu/iommufd_utils.h +++ b/tools/testing/selftests/iommu/iommufd_utils.h @@ -98,6 +98,9 @@ static int _test_cmd_mock_domain_flags(int fd, unsigned int ioas_id, *idev_id = cmd.mock_domain_flags.out_idev_id; return 0; } +#define test_cmd_mock_domain_flags(ioas_id, flags, stdev_id, hwpt_id, idev_id) \ + ASSERT_EQ(0, _test_cmd_mock_domain_flags(self->fd, ioas_id, flags, \ + stdev_id, hwpt_id, idev_id)) #define test_err_mock_domain_flags(_errno, ioas_id, flags, stdev_id, hwpt_id) \ EXPECT_ERRNO(_errno, \ _test_cmd_mock_domain_flags(self->fd, ioas_id, flags, \ |