iommufd/selftest: Add set_dev_pasid in mock iommu
authorYi Liu <yi.l.liu@intel.com>
Fri, 21 Mar 2025 17:19:37 +0000 (10:19 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 25 Mar 2025 13:18:31 +0000 (10:18 -0300)
commit9eb59204d5197b4add63968c8c5b7633631f9a5a
treef763c69a07a1cbcbccb4544283b7ecedcaf8743f
parentdbc5f37b4f8ad833132f77c1f67e68bb11ca9b9e
iommufd/selftest: Add set_dev_pasid in mock iommu

The callback is needed to make pasid_attach/detach path complete for mock
device. A nop is enough for set_dev_pasid.

A MOCK_FLAGS_DEVICE_PASID is added to indicate a pasid-capable mock device
for the pasid test cases. Other test cases will still create a non-pasid
mock device. While the mock iommu always pretends to be pasid-capable.

Link: https://patch.msgid.link/r/20250321171940.7213-16-yi.l.liu@intel.com
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Tested-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