History

Merge branches 'v5.4/vfio/alexey-tce-memory-free-v1', 'v5.4/vfio/connie-re-arrange-v2', 'v5.4/vfio/hexin-pci-reset-v3', 'v5.4/vfio/parav-mtty-uuid-v2' and 'v5.4/vfio/shameer-iova-list-v8' into v5.4/vfio/next

Alex Williamson committed 7 years ago

Commit e6c5d726 parents e3fb13b 78becab db2cb96 92c8026 eee413e b09d6e45 files · +583 −71Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/vfio.h+51−20
@@ -295,15 +295,38 @@ struct vfio_region_info_cap_type { · 294 unmodified lines
295295 __u32 subtype; /* type specific */
296296 };
297297
298+/*
299+ * List of region types, global per bus driver.
300+ * If you introduce a new type, please add it here.
301+ */
302+
303+/* PCI region type containing a PCI vendor part */
298304 #define VFIO_REGION_TYPE_PCI_VENDOR_TYPE (1 << 31)
299305 #define VFIO_REGION_TYPE_PCI_VENDOR_MASK (0xffff)
306+#define VFIO_REGION_TYPE_GFX (1)
307+#define VFIO_REGION_TYPE_CCW (2)
308+
309+/* sub-types for VFIO_REGION_TYPE_PCI_* */
300310
301−/* 8086 Vendor sub-types */
311+/* 8086 vendor PCI sub-types */
302312 #define VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION (1)
303313 #define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2)
304314 #define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3)
305315
306−#define VFIO_REGION_TYPE_GFX (1)
316+/* 10de vendor PCI sub-types */
317+/*
318+ * NVIDIA GPU NVlink2 RAM is coherent RAM mapped onto the host address space.
319+ */
320+#define VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM (1)
321+
322+/* 1014 vendor PCI sub-types */
323+/*
324+ * IBM NPU NVlink2 ATSD (Address Translation Shootdown) register of NPU
325+ * to do TLB invalidation on a GPU.
326+ */
327+#define VFIO_REGION_SUBTYPE_IBM_NVLINK2_ATSD (1)
328+
329+/* sub-types for VFIO_REGION_TYPE_GFX */
307330 #define VFIO_REGION_SUBTYPE_GFX_EDID (1)
308331
309332 /**
@@ -353,25 +376,9 @@ struct vfio_region_gfx_edid { · 43 unmodified lines
353376 #define VFIO_DEVICE_GFX_LINK_STATE_DOWN 2
354377 };
355378
356−#define VFIO_REGION_TYPE_CCW (2)
357−/* ccw sub-types */
379+/* sub-types for VFIO_REGION_TYPE_CCW */
358380 #define VFIO_REGION_SUBTYPE_CCW_ASYNC_CMD (1)
359381
360−/*
361− * 10de vendor sub-type
362− *
363− * NVIDIA GPU NVlink2 RAM is coherent RAM mapped onto the host address space.
364− */
365−#define VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM (1)
366−
367−/*
368− * 1014 vendor sub-type
369− *
370− * IBM NPU NVlink2 ATSD (Address Translation Shootdown) register of NPU
371− * to do TLB invalidation on a GPU.
372− */
373−#define VFIO_REGION_SUBTYPE_IBM_NVLINK2_ATSD (1)
374−
375382 /*
376383 * The MSIX mappable capability informs that MSIX data of a BAR can be mmapped
377384 * which allows direct access to non-MSIX registers which happened to be within
@@ -714,7 +721,31 @@ struct vfio_iommu_type1_info { · 336 unmodified lines
714721 __u32 argsz;
715722 __u32 flags;
716723 #define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */
717− __u64 iova_pgsizes; /* Bitmap of supported page sizes */
724+#define VFIO_IOMMU_INFO_CAPS (1 << 1) /* Info supports caps */
725+ __u64 iova_pgsizes; /* Bitmap of supported page sizes */
726+ __u32 cap_offset; /* Offset within info struct of first cap */
727+};
728+
729+/*
730+ * The IOVA capability allows to report the valid IOVA range(s)
731+ * excluding any non-relaxable reserved regions exposed by
732+ * devices attached to the container. Any DMA map attempt
733+ * outside the valid iova range will return error.
734+ *
735+ * The structures below define version 1 of this capability.
736+ */
737+#define VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE 1
738+
739+struct vfio_iova_range {
740+ __u64 start;
741+ __u64 end;
742+};
743+
744+struct vfio_iommu_type1_info_cap_iova_range {
745+ struct vfio_info_cap_header header;
746+ __u32 nr_iovas;
747+ __u32 reserved;
748+ struct vfio_iova_range iova_ranges[];
718749 };
719750
720751 #define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)