From b277d5602dfb9000e283837632b388ea22da1f62 Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Wed, 7 Feb 2024 12:42:21 -0400 Subject: sys/linux: correct iommufd definitions Some small mistakes have crept into here and the definitions are not working quite right The kernel changed the layout of the mock_domain test command to have three handles and moved the device_handl to the end. A new handle - the "selftest_device" was returned instead. check_map/check_refs takes in a hwpt_handle not an fd_access domain_replace takes in the selftest_device_handle and an ioas/pt access_replace_ioas uses the ioas_handle not a naked int32. --- sys/linux/dev_iommu.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'sys') diff --git a/sys/linux/dev_iommu.txt b/sys/linux/dev_iommu.txt index c8422c8e0..fa70d3a15 100644 --- a/sys/linux/dev_iommu.txt +++ b/sys/linux/dev_iommu.txt @@ -193,6 +193,7 @@ resource device_handle[int32] resource hwpt_handle[int32] resource fd_access[fd] resource access_pages_handle[int32] +resource selftest_device_handle[int32] ioctl$IOMMU_TEST_OP_ADD_RESERVED(fd fd_iommufd, cmd const[IOMMU_TEST_CMD], arg ptr[in, iommu_test_cmd$add_reserved]) ioctl$IOMMU_TEST_OP_MOCK_DOMAIN(fd fd_iommufd, cmd const[IOMMU_TEST_CMD], arg ptr[in, iommu_test_cmd$mock_domain]) @@ -225,14 +226,15 @@ iommu_test_cmd$mock_domain { op const[IOMMU_TEST_OP_MOCK_DOMAIN, int32] id ioas_handle __reserved const[0x0, int32] - out_device_id device_handle (out) + out_stdev_id selftest_device_handle (out) out_hwpt_id hwpt_handle (out) + out_idev_id device_handle (out) } [size[IOMMU_TEST_CMD_SIZE]] iommu_test_cmd$md_check_map { size len[parent, int32] op const[IOMMU_TEST_OP_MD_CHECK_MAP, int32] - id fd_access + id hwpt_handle __reserved const[0x0, int32] iova int64 length len[uptr, int64] @@ -242,7 +244,7 @@ iommu_test_cmd$md_check_map { iommu_test_cmd$md_check_refs { size len[parent, int32] op const[IOMMU_TEST_OP_MD_CHECK_REFS, int32] - id fd_access + id const[0x0, int32] __reserved const[0x0, int32] length len[uptr, int64] uptr ptr64[in, array[int8]] @@ -329,9 +331,10 @@ iommu_test_cmd$memory_limit { iommu_test_cmd$mock_domain_replace { size len[parent, int32] op const[IOMMU_TEST_OP_MOCK_DOMAIN_REPLACE, int32] - id ioas_handle + id selftest_device_handle __reserved const[0x0, int32] - pt_id int32 +# or hwpt_handle + pt_id ioas_handle } [size[IOMMU_TEST_CMD_SIZE]] iommu_test_cmd$access_replace_ioas { @@ -339,7 +342,7 @@ iommu_test_cmd$access_replace_ioas { op const[IOMMU_TEST_OP_ACCESS_REPLACE_IOAS, int32] id fd_access __reserved const[0x0, int32] - ioas_id int32 + ioas_id ioas_handle } [size[IOMMU_TEST_CMD_SIZE]] iommu_destroy$device { -- cgit mrf-deployment