From f096de4a8cbecffe7d41697a93fdc4ac27e593bc Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Thu, 8 Feb 2024 14:25:34 -0400 Subject: sys/linux: add IOMMU_HWPT_SET_DIRTY_TRACKING --- sys/linux/dev_iommu.txt | 9 +++++++++ sys/linux/dev_iommu.txt.const | 2 ++ sys/linux/test/dev_iommu | 6 ++++++ 3 files changed, 17 insertions(+) (limited to 'sys') 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, 0x0, 0x0, 0x0}) +ioctl$IOMMU_HWPT_ALLOC$NONE(r0, 0x3b89, &AUTO={0x28, 0x2, r2, r1, 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}) -- cgit mrf-deployment