iommufd/selftest: Add nested domain allocation for mock domain
authorNicolin Chen <nicolinc@nvidia.com>
Thu, 26 Oct 2023 04:39:37 +0000 (21:39 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 26 Oct 2023 14:15:57 +0000 (11:15 -0300)
commit65fe32f7a4472e19331a524b9c980b3444dd20a2
tree77f3acae9decc4a571019402744620167879abae
parente9d36c07bb787840e4813fb09a929a17d522a69f
iommufd/selftest: Add nested domain allocation for mock domain

Add nested domain support in the ->domain_alloc_user op with some proper
sanity checks. Then, add a domain_nested_ops for all nested domains and
split the get_md_pagetable helper into paging and nested helpers.

Also, add an iotlb as a testing property of a nested domain.

Link: https://lore.kernel.org/r/20231026043938.63898-10-yi.l.liu@intel.com
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/iommufd_test.h
drivers/iommu/iommufd/selftest.c