linux/tools/testing/selftests/iommu
Jason Gunthorpe 65c619ae06 iommufd/selftest: Make selftest create a more complete mock device
iommufd wants to use more infrastructure, like the iommu_group, that the
mock device does not support. Create a more complete mock device that can
go through the whole cycle of ownership, blocking domain, and has an
iommu_group.

This requires creating a real struct device on a real bus to be able to
connect it to a iommu_group. Unfortunately we cannot formally attach the
mock iommu driver as an actual driver as the iommu core does not allow
more than one driver or provide a general way for busses to link to
iommus. This can be solved with a little hack to open code the dev_iommus
struct.

With this infrastructure things work exactly the same as the normal domain
path, including the auto domains mechanism and direct attach of hwpts.  As
the created hwpt is now an autodomain it is no longer required to destroy
it and trying to do so will trigger a failure.

Link: https://lore.kernel.org/r/11-v3-ae9c2975a131+2e1e8-iommufd_hwpt_jgg@nvidia.com
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2023-03-06 13:06:11 -04:00
..
.gitignore
config
iommufd_fail_nth.c iommufd/selftest: Make selftest create a more complete mock device 2023-03-06 13:06:11 -04:00
iommufd_utils.h iommufd/selftest: Rename the sefltest 'device_id' to 'stdev_id' 2023-03-06 10:51:58 -04:00
iommufd.c iommufd/selftest: Make selftest create a more complete mock device 2023-03-06 13:06:11 -04:00
Makefile selftests: iommu: Use installed kernel headers search path 2023-02-13 09:09:46 -07:00