From b44f1eafe16bf261642c5390ba0e2adc4cedd5ef Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Wed, 7 Feb 2024 16:49:24 -0400 Subject: sys/linux: add IOMMU_GET_HW_INFO --- sys/linux/dev_iommu.txt | 13 +++++++++++++ sys/linux/dev_iommu.txt.const | 1 + sys/linux/test/dev_iommu | 1 + 3 files changed, 15 insertions(+) (limited to 'sys/linux') 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, 0x0, 0x0 ioctl$IOMMU_HWPT_ALLOC$TEST(r0, 0x3b89, &AUTO={0x28, 0, r2, r3, 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}) -- cgit mrf-deployment