summaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorMatthew Rosato <mjrosato@linux.ibm.com>2020-09-15 15:05:18 -0400
committerAlex Williamson <alex.williamson@redhat.com>2020-09-21 14:58:34 -0600
commit7d6e1329652ed971d1b6e0e7bea66fba5044e271 (patch)
treecc46122738f89fed688be8c3af783ed592a3a3eb /include/uapi
parentba4f184e126b751d1bffad5897f263108befc780 (diff)
downloadlinux-stable-7d6e1329652ed971d1b6e0e7bea66fba5044e271.tar.gz
linux-stable-7d6e1329652ed971d1b6e0e7bea66fba5044e271.tar.bz2
linux-stable-7d6e1329652ed971d1b6e0e7bea66fba5044e271.zip
vfio iommu: Add dma available capability
Commit 492855939bdb ("vfio/type1: Limit DMA mappings per container") added the ability to limit the number of memory backed DMA mappings. However on s390x, when lazy mapping is in use, we use a very large number of concurrent mappings. Let's provide the current allowable number of DMA mappings to userspace via the IOMMU info chain so that userspace can take appropriate mitigation. Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/vfio.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index 920470502329..3891e03d3af0 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -1039,6 +1039,21 @@ struct vfio_iommu_type1_info_cap_migration {
__u64 max_dirty_bitmap_size; /* in bytes */
};
+/*
+ * The DMA available capability allows to report the current number of
+ * simultaneously outstanding DMA mappings that are allowed.
+ *
+ * The structure below defines version 1 of this capability.
+ *
+ * avail: specifies the current number of outstanding DMA mappings allowed.
+ */
+#define VFIO_IOMMU_TYPE1_INFO_DMA_AVAIL 3
+
+struct vfio_iommu_type1_info_dma_avail {
+ struct vfio_info_cap_header header;
+ __u32 avail;
+};
+
#define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
/**