aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2024-02-08 14:25:34 -0400
committerAleksandr Nogikh <nogikh@google.com>2024-03-13 10:41:39 +0000
commitf096de4a8cbecffe7d41697a93fdc4ac27e593bc (patch)
tree74f3461e1e947e00c3d5419f8b42f72504707772 /sys
parentb44f1eafe16bf261642c5390ba0e2adc4cedd5ef (diff)
sys/linux: add IOMMU_HWPT_SET_DIRTY_TRACKING
Diffstat (limited to 'sys')
-rw-r--r--sys/linux/dev_iommu.txt9
-rw-r--r--sys/linux/dev_iommu.txt.const2
-rw-r--r--sys/linux/test/dev_iommu6
3 files changed, 17 insertions, 0 deletions
diff --git a/sys/linux/dev_iommu.txt b/sys/linux/dev_iommu.txt
index 50498836c..b2671a0d9 100644
--- a/sys/linux/dev_iommu.txt
+++ b/sys/linux/dev_iommu.txt
@@ -36,6 +36,7 @@ ioctl$IOMMU_HWPT_ALLOC$NONE(fd fd_iommufd, cmd const[IOMMU_HWPT_ALLOC], arg ptr[
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])
+ioctl$IOMMU_HWPT_SET_DIRTY_TRACKING(fd fd_iommufd, cmd const[IOMMU_HWPT_SET_DIRTY_TRACKING], arg ptr[in, iommu_hwpt_set_dirty_tracking])
# VFIO compatibility ioctls
# This shares a few structs with dev_vfio.txt
@@ -206,6 +207,13 @@ iommu_hw_info {
out_capabilities int64 (out)
}
+iommu_hwpt_set_dirty_tracking {
+ size len[parent, int32]
+ flags flags[iommufd_hwpt_set_dirty_tracking_flags, int32]
+ hwpt_id hwpt_handle
+ __reserved const[0x0, int32]
+}
+
iommu_iova_range {
start int64
last int64
@@ -215,6 +223,7 @@ iommufd_ioas_map_flags = IOMMU_IOAS_MAP_FIXED_IOVA, IOMMU_IOAS_MAP_WRITEABLE, IO
iommufd_ioas_map_flags_syz = MOCK_FLAGS_ACCESS_SYZ, IOMMU_IOAS_MAP_WRITEABLE, IOMMU_IOAS_MAP_READABLE, MOCK_FLAGS_ACCESS_SYZ, IOMMU_IOAS_MAP_READABLE
iommufd_option_ops = IOMMU_OPTION_OP_SET, IOMMU_OPTION_OP_GET
iommufd_hwpt_alloc_flags = IOMMU_HWPT_ALLOC_NEST_PARENT, IOMMU_HWPT_ALLOC_DIRTY_TRACKING
+iommufd_hwpt_set_dirty_tracking_flags = IOMMU_HWPT_DIRTY_TRACKING_ENABLE
iommu_type = VFIO_TYPE1_IOMMU, VFIO_TYPE1v2_IOMMU
iommu_extension = VFIO_TYPE1_IOMMU, VFIO_TYPE1v2_IOMMU, VFIO_UNMAP_ALL, VFIO_DMA_CC_IOMMU, VFIO_TYPE1_NESTING_IOMMU, VFIO_UPDATE_VADDR
diff --git a/sys/linux/dev_iommu.txt.const b/sys/linux/dev_iommu.txt.const
index 4c8160510..259d06db8 100644
--- a/sys/linux/dev_iommu.txt.const
+++ b/sys/linux/dev_iommu.txt.const
@@ -8,6 +8,8 @@ IOMMU_HWPT_ALLOC_DIRTY_TRACKING = 2
IOMMU_HWPT_ALLOC_NEST_PARENT = 1
IOMMU_HWPT_DATA_NONE = 0
IOMMU_HWPT_DATA_SELFTEST = 57005
+IOMMU_HWPT_DIRTY_TRACKING_ENABLE = 1
+IOMMU_HWPT_SET_DIRTY_TRACKING = 15243, mips64le:ppc64le:536886155
IOMMU_IOAS_ALLOC = 15233, mips64le:ppc64le:536886145
IOMMU_IOAS_ALLOW_IOVAS = 15234, mips64le:ppc64le:536886146
IOMMU_IOAS_COPY = 15235, mips64le:ppc64le:536886147
diff --git a/sys/linux/test/dev_iommu b/sys/linux/test/dev_iommu
index df61f17fb..1dfc573a0 100644
--- a/sys/linux/test/dev_iommu
+++ b/sys/linux/test/dev_iommu
@@ -64,6 +64,12 @@ 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_MOCK_DOMAIN(r0, 0x3ba0, &AUTO={0x48, 0x2, r1, 0x0, <r4=>0x0, <r3=>0x0, <r2=>0x0})
+ioctl$IOMMU_HWPT_ALLOC$NONE(r0, 0x3b89, &AUTO={0x28, 0x2, r2, r1, <r3=>0x0, 0x0, 0x0, 0x0, &AUTO=''})
+ioctl$IOMMU_HWPT_SET_DIRTY_TRACKING(r0, 0x3b8b, &AUTO={0x16, 0x1, r3, 0x0})
+ioctl$IOMMU_DESTROY$hwpt(r0, 0x3b80, &AUTO={0x8, r3})
+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})
ioctl$IOMMU_DESTROY$ioas(r0, 0x3b80, &AUTO={0x8, r1})