[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC 05/10] linux-headers: import iommufd.h hwpt extensions
From: |
Joao Martins |
Subject: |
[PATCH RFC 05/10] linux-headers: import iommufd.h hwpt extensions |
Date: |
Thu, 28 Apr 2022 22:13:46 +0100 |
Generated from `scripts/update-linux-headers`
from github.com:jpemartins/linux:iommufd
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
---
linux-headers/linux/iommufd.h | 78 +++++++++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
diff --git a/linux-headers/linux/iommufd.h b/linux-headers/linux/iommufd.h
index 6c3cd9e259e2..e3c981f81e43 100644
--- a/linux-headers/linux/iommufd.h
+++ b/linux-headers/linux/iommufd.h
@@ -43,6 +43,9 @@ enum {
IOMMUFD_CMD_IOAS_COPY,
IOMMUFD_CMD_IOAS_UNMAP,
IOMMUFD_CMD_VFIO_IOAS,
+ IOMMUFD_CMD_HWPT_SET_DIRTY,
+ IOMMUFD_CMD_HWPT_GET_DIRTY_IOVA,
+ IOMMUFD_CMD_IOAS_UNMAP_DIRTY,
};
/**
@@ -220,4 +223,79 @@ struct iommu_vfio_ioas {
__u16 __reserved;
};
#define IOMMU_VFIO_IOAS _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VFIO_IOAS)
+
+/**
+ * enum iommufd_set_dirty_flags - Flags for steering dirty tracking
+ * @IOMMU_DIRTY_TRACKING_DISABLED: Disables dirty tracking
+ * @IOMMU_DIRTY_TRACKING_ENABLED: Enables dirty tracking
+ */
+enum iommufd_set_dirty_flags {
+ IOMMU_DIRTY_TRACKING_DISABLED = 0,
+ IOMMU_DIRTY_TRACKING_ENABLED = 1 << 0,
+};
+
+/**
+ * struct iommu_hwpt_set_dirty - ioctl(IOMMU_HWPT_SET_DIRTY)
+ * @size: sizeof(struct iommu_hwpt_set_dirty)
+ * @flags: Flags to control dirty tracking status.
+ * @hwpt_id: HW pagetable ID that represents the IOMMU domain.
+ *
+ * Toggle dirty tracking on an HW pagetable.
+ */
+struct iommu_hwpt_set_dirty {
+ __u32 size;
+ __u32 flags;
+ __u32 hwpt_id;
+ __u32 __reserved;
+};
+#define IOMMU_HWPT_SET_DIRTY _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_SET_DIRTY)
+
+/**
+ * struct iommufd_dirty_bitmap - Dirty IOVA tracking bitmap
+ * @iova: base IOVA of the bitmap
+ * @length: IOVA size
+ * @page_size: page size granularity of each bit in the bitmap
+ * @data: bitmap where to set the dirty bits. The bitmap bits each
+ * represent a page_size which you deviate from an arbitrary iova.
+ * Checking a given IOVA is dirty:
+ *
+ * data[(iova / page_size) / 64] & (1ULL << (iova % 64))
+ */
+struct iommufd_dirty_data {
+ __aligned_u64 iova;
+ __aligned_u64 length;
+ __aligned_u64 page_size;
+ __aligned_u64 *data;
+};
+
+/**
+ * struct iommu_hwpt_get_dirty_iova - ioctl(IOMMU_HWPT_GET_DIRTY_IOVA)
+ * @size: sizeof(struct iommu_hwpt_get_dirty_iova)
+ * @bitmap: Bitmap of the range of IOVA to read out
+ */
+struct iommu_hwpt_get_dirty_iova {
+ __u32 size;
+ __u32 hwpt_id;
+ struct iommufd_dirty_data bitmap;
+};
+#define IOMMU_HWPT_GET_DIRTY_IOVA _IO(IOMMUFD_TYPE,
IOMMUFD_CMD_HWPT_GET_DIRTY_IOVA)
+
+/**
+ * struct iommu_hwpt_unmap - ioctl(IOMMU_HWPT_UNMAP_DIRTY)
+ * @size: sizeof(struct iommu_hwpt_unmap_dirty)
+ * @ioas_id: IOAS ID to unmap the mapping of
+ * @data: Dirty data of the range of IOVA to unmap
+ *
+ * Unmap an IOVA range and return a bitmap of the dirty bits.
+ * The iova/length must exactly match a range
+ * used with IOMMU_IOAS_PAGETABLE_MAP, or be the values 0 & U64_MAX.
+ * In the latter case all IOVAs will be unmaped.
+ */
+struct iommu_ioas_unmap_dirty {
+ __u32 size;
+ __u32 ioas_id;
+ struct iommufd_dirty_data bitmap;
+};
+#define IOMMU_IOAS_UNMAP_DIRTY _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_UNMAP_DIRTY)
+
#endif
--
2.17.2
- [PATCH RFC 00/10] hw/vfio, x86/iommu: IOMMUFD Dirty Tracking, Joao Martins, 2022/04/28
- [PATCH RFC 01/10] amd-iommu: Cache PTE/DTE info in IOTLB, Joao Martins, 2022/04/28
- [PATCH RFC 04/10] intel_iommu: Second Stage Access Dirty bit support, Joao Martins, 2022/04/28
- [PATCH RFC 02/10] amd-iommu: Access/Dirty bit support, Joao Martins, 2022/04/28
- [PATCH RFC 03/10] intel-iommu: Cache PASID entry flags, Joao Martins, 2022/04/28
- [PATCH RFC 05/10] linux-headers: import iommufd.h hwpt extensions,
Joao Martins <=
- [PATCH RFC 07/10] vfio/iommufd: Add HWPT_GET_DIRTY_IOVA support, Joao Martins, 2022/04/28
- [PATCH RFC 08/10] vfio/iommufd: Add IOAS_UNMAP_DIRTY support, Joao Martins, 2022/04/28
- [PATCH RFC 06/10] vfio/iommufd: Add HWPT_SET_DIRTY support, Joao Martins, 2022/04/28
- [PATCH RFC 09/10] migration/dirtyrate: Expand dirty_bitmap to be tracked separately for devices, Joao Martins, 2022/04/28
- [PATCH RFC 10/10] hw/vfio: Add nr of dirty pages to tracepoints, Joao Martins, 2022/04/28