aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2024-02-07 16:49:24 -0400
committerAleksandr Nogikh <nogikh@google.com>2024-03-13 10:41:39 +0000
commitb44f1eafe16bf261642c5390ba0e2adc4cedd5ef (patch)
tree046c80c1051d9c304497076400da3cb4949c9ff8 /sys/linux
parent400732e21bdb27e4c3e1c2cf933c4f57fab7d4f8 (diff)
sys/linux: add IOMMU_GET_HW_INFO
Diffstat (limited to 'sys/linux')
-rw-r--r--sys/linux/dev_iommu.txt13
-rw-r--r--sys/linux/dev_iommu.txt.const1
-rw-r--r--sys/linux/test/dev_iommu1
3 files changed, 15 insertions, 0 deletions
diff --git a/sys/linux/dev_iommu.txt b/sys/linux/dev_iommu.txt
index 482d81053..50498836c 100644
--- a/sys/linux/dev_iommu.txt
+++ b/sys/linux/dev_iommu.txt
@@ -35,6 +35,8 @@ ioctl$IOMMU_VFIO_IOAS$CLEAR(fd fd_iommufd, cmd const[IOMMU_VFIO_IOAS], arg ptr[i
ioctl$IOMMU_HWPT_ALLOC$NONE(fd fd_iommufd, cmd const[IOMMU_HWPT_ALLOC], arg ptr[in, iommu_hwpt_alloc$IOMMU_HWPT_DATA_NONE])
ioctl$IOMMU_HWPT_ALLOC$TEST(fd fd_iommufd, cmd const[IOMMU_HWPT_ALLOC], arg ptr[in, iommu_hwpt_alloc$IOMMU_HWPT_DATA_SELFTEST])
+ioctl$IOMMU_GET_HW_INFO(fd fd_iommufd, cmd const[IOMMU_GET_HW_INFO], arg ptr[in, iommu_hw_info])
+
# VFIO compatibility ioctls
# This shares a few structs with dev_vfio.txt
ioctl$IOMMU_VFIO_GET_API_VERSION(fd fd_iommufd, cmd const[VFIO_GET_API_VERSION])
@@ -193,6 +195,17 @@ iommu_hwpt_selftest {
type iommu_hwpt_alloc$IOMMU_HWPT_DATA_SELFTEST iommu_hwpt_alloc[IOMMU_HWPT_DATA_SELFTEST, iommu_hwpt_selftest]
+iommu_hw_info {
+ size len[parent, int32]
+ flags const[0x0, int32]
+ dev_id device_handle
+ data_len len[data_uptr, int32]
+ data_uptr ptr64[out, array[int8]]
+ out_data_type int32 (out)
+ __reserved const[0x0, int32]
+ out_capabilities int64 (out)
+}
+
iommu_iova_range {
start int64
last int64
diff --git a/sys/linux/dev_iommu.txt.const b/sys/linux/dev_iommu.txt.const
index 4483b88da..4c8160510 100644
--- a/sys/linux/dev_iommu.txt.const
+++ b/sys/linux/dev_iommu.txt.const
@@ -2,6 +2,7 @@
arches = 386, amd64, arm, arm64, mips64le, ppc64le, riscv64, s390x
AT_FDCWD = 18446744073709551516
IOMMU_DESTROY = 15232, mips64le:ppc64le:536886144
+IOMMU_GET_HW_INFO = 15242, mips64le:ppc64le:536886154
IOMMU_HWPT_ALLOC = 15241, mips64le:ppc64le:536886153
IOMMU_HWPT_ALLOC_DIRTY_TRACKING = 2
IOMMU_HWPT_ALLOC_NEST_PARENT = 1
diff --git a/sys/linux/test/dev_iommu b/sys/linux/test/dev_iommu
index 4b3efaf75..df61f17fb 100644
--- a/sys/linux/test/dev_iommu
+++ b/sys/linux/test/dev_iommu
@@ -61,6 +61,7 @@ ioctl$IOMMU_HWPT_ALLOC$NONE(r0, 0x3b89, &AUTO={0x28, 0x1, r2, r1, <r3=>0x0, 0x0
ioctl$IOMMU_HWPT_ALLOC$TEST(r0, 0x3b89, &AUTO={0x28, 0, r2, r3, <r5=>0x0, 0x0, 0xdead, 0x4, &AUTO={0xbadbeef}})
ioctl$IOMMU_DESTROY$hwpt(r0, 0x3b80, &AUTO={0x8, r5})
ioctl$IOMMU_DESTROY$hwpt(r0, 0x3b80, &AUTO={0x8, r3})
+ioctl$IOMMU_GET_HW_INFO(r0, 0x3b8a, &AUTO={0x24, 0x0, r2, 0x1c, &AUTO='LLLLLLLLLLLLLLLLLLLLLLLLLLLL', 0x0, 0x0, 0x0})
ioctl$IOMMU_DESTROY$stdev(r0, 0x3b80, &AUTO={0x8, r4})
ioctl$IOMMU_TEST_OP_SET_TEMP_MEMORY_LIMIT(r0, 0x3ba0, &AUTO={0x48, 0x9, 0x0, 0x0, 0x10})