diff options
| author | Jason Gunthorpe <jgg@nvidia.com> | 2023-07-17 15:12:15 -0300 |
|---|---|---|
| committer | Jason Gunthorpe <jgg@nvidia.com> | 2023-07-26 10:20:41 -0300 |
| commit | 6583c865dec5493beb4c72fd724eb9d43d8d7ebb (patch) | |
| tree | bd59bd6893b066879bd10b58d8ced989a8fd97a0 /drivers | |
| parent | 7a467e02b339a50ed2762edd72e763925ac2b0a3 (diff) | |
iommufd/selftest: Add a selftest for IOMMU_HWPT_ALLOC
Test the basic flow.
Link: https://lore.kernel.org/r/19-v8-6659224517ea+532-iommufd_alloc_jgg@nvidia.com
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/iommu/iommufd/io_pagetable.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iommu/iommufd/io_pagetable.c b/drivers/iommu/iommufd/io_pagetable.c index 112bea5a84e4..4d095115c2d0 100644 --- a/drivers/iommu/iommufd/io_pagetable.c +++ b/drivers/iommu/iommufd/io_pagetable.c @@ -1180,6 +1180,9 @@ int iopt_table_enforce_dev_resv_regions(struct io_pagetable *iopt, unsigned int num_sw_msi = 0; int rc; + if (iommufd_should_fail()) + return -EINVAL; + down_write(&iopt->iova_rwsem); /* FIXME: drivers allocate memory but there is no failure propogated */ iommu_get_resv_regions(dev, &resv_regions); |
