iommufd/selftest: Add IOMMU_TEST_OP_ACCESS_REPLACE_IOAS coverage
authorNicolin Chen <nicolinc@nvidia.com>
Fri, 28 Jul 2023 06:33:28 +0000 (23:33 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 28 Jul 2023 16:31:24 +0000 (13:31 -0300)
commitc154660b6e26c3f0670a49f43f1fafa5d65f6d39
treefb647a97f267f3b132c03549e7cda50e2adcd1be
parent70c16123d865046899c36e3655b2d611f38f51a3
iommufd/selftest: Add IOMMU_TEST_OP_ACCESS_REPLACE_IOAS coverage

Add a new IOMMU_TEST_OP_ACCESS_REPLACE_IOAS to allow replacing the
access->ioas, corresponding to the iommufd_access_replace() helper.

Then add replace coverage as a part of user_copy test case, which
basically repeats the copy test after replacing the old ioas with a new
one.

Link: https://lore.kernel.org/r/a4897f93d41c34b972213243b8dbf4c3832842e4.1690523699.git.nicolinc@nvidia.com
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.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