summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/iommufd
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2023-07-17 15:12:14 -0300
committerJason Gunthorpe <jgg@nvidia.com>2023-07-26 10:20:36 -0300
commit7a467e02b339a50ed2762edd72e763925ac2b0a3 (patch)
treec3722e12003b75e6f38d2116324075931e285ab8 /drivers/iommu/iommufd
parent7074d7bd67d495cb3f6fe7c7c96b357a3b9d4ec2 (diff)
downloadlinux-7a467e02b339a50ed2762edd72e763925ac2b0a3.tar.gz
linux-7a467e02b339a50ed2762edd72e763925ac2b0a3.tar.bz2
linux-7a467e02b339a50ed2762edd72e763925ac2b0a3.zip
iommufd/selftest: Return the real idev id from selftest mock_domain
Now that we actually call iommufd_device_bind() we can return the idev_id from that function to userspace for use in other APIs. Link: https://lore.kernel.org/r/18-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/iommu/iommufd')
-rw-r--r--drivers/iommu/iommufd/iommufd_test.h2
-rw-r--r--drivers/iommu/iommufd/selftest.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iommu/iommufd/iommufd_test.h b/drivers/iommu/iommufd/iommufd_test.h
index e3f1035cbd64..dd9168a20ddf 100644
--- a/drivers/iommu/iommufd/iommufd_test.h
+++ b/drivers/iommu/iommufd/iommufd_test.h
@@ -52,6 +52,8 @@ struct iommu_test_cmd {
struct {
__u32 out_stdev_id;
__u32 out_hwpt_id;
+ /* out_idev_id is the standard iommufd_bind object */
+ __u32 out_idev_id;
} mock_domain;
struct {
__u32 pt_id;
diff --git a/drivers/iommu/iommufd/selftest.c b/drivers/iommu/iommufd/selftest.c
index eb33dffb955d..9d43334e4faf 100644
--- a/drivers/iommu/iommufd/selftest.c
+++ b/drivers/iommu/iommufd/selftest.c
@@ -443,6 +443,7 @@ static int iommufd_test_mock_domain(struct iommufd_ucmd *ucmd,
/* Userspace must destroy the device_id to destroy the object */
cmd->mock_domain.out_hwpt_id = pt_id;
cmd->mock_domain.out_stdev_id = sobj->obj.id;
+ cmd->mock_domain.out_idev_id = idev_id;
iommufd_object_finalize(ucmd->ictx, &sobj->obj);
return iommufd_ucmd_respond(ucmd, sizeof(*cmd));