iommufd/selftest: Add mock IO hugepages tests
authorJoao Martins <joao.m.martins@oracle.com>
Fri, 2 Feb 2024 13:34:14 +0000 (13:34 +0000)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 6 Feb 2024 15:31:46 +0000 (11:31 -0400)
commitfe13166f0562117c42fc60a109e664a914523e63
tree7b3eb591682643ba3bdc88279ec803693257181a
parent7db521e23fe9e36855b61b01a67291281118570e
iommufd/selftest: Add mock IO hugepages tests

Leverage previously added MOCK_FLAGS_DEVICE_HUGE_IOVA flag to create an
IOMMU domain with more than MOCK_IO_PAGE_SIZE supported.

Plumb the hugetlb backing memory for buffer allocation and change the
expected page size to MOCK_HUGE_PAGE_SIZE (1M) when hugepage variant test
cases are used. These so far are limited to 128M and 256M IOVA range tests
cases which is when 1M hugepages can be used.

Link: https://lore.kernel.org/r/20240202133415.23819-9-joao.m.martins@oracle.com
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
tools/testing/selftests/iommu/iommufd.c