iommufd/selftest: Add coverage for IOMMU_GET_HW_INFO ioctl
authorNicolin Chen <nicolinc@nvidia.com>
Fri, 18 Aug 2023 10:10:32 +0000 (03:10 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 18 Aug 2023 15:52:15 +0000 (12:52 -0300)
commitaf4fde93c3196ed2cd4e64109a9307a7bc471c5a
treea516c6354b4e9a6383051732048fd027d4137742
parent55dd4023cead250c89decf1a7a882c94cbf5765a
iommufd/selftest: Add coverage for IOMMU_GET_HW_INFO ioctl

Add a mock_domain_hw_info function and an iommu_test_hw_info data
structure. This allows to test the IOMMU_GET_HW_INFO ioctl passing the
test_reg value for the mock_dev.

Link: https://lore.kernel.org/r/20230818101033.4100-5-yi.l.liu@intel.com
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.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_fail_nth.c
tools/testing/selftests/iommu/iommufd_utils.h