Merge tag 'upstream/16.11.9' into 16.11.x
[deb_dpdk.git] / lib / librte_eal / linuxapp / eal / eal_vfio.h
index 29f7f3e..72f1f75 100644 (file)
 
 #define RTE_VFIO_TYPE1 VFIO_TYPE1_IOMMU
 
+#ifndef VFIO_SPAPR_TCE_v2_IOMMU
+#define RTE_VFIO_SPAPR 7
+#define VFIO_IOMMU_SPAPR_REGISTER_MEMORY _IO(VFIO_TYPE, VFIO_BASE + 17)
+#define VFIO_IOMMU_SPAPR_TCE_CREATE _IO(VFIO_TYPE, VFIO_BASE + 19)
+#define VFIO_IOMMU_SPAPR_TCE_REMOVE _IO(VFIO_TYPE, VFIO_BASE + 20)
+
+struct vfio_iommu_spapr_register_memory {
+       uint32_t argsz;
+       uint32_t flags;
+       uint64_t vaddr;
+       uint64_t size;
+};
+
+struct vfio_iommu_spapr_tce_create {
+       uint32_t argsz;
+       uint32_t page_shift;
+       uint64_t window_size;
+       uint32_t levels;
+};
+
+struct vfio_iommu_spapr_tce_remove {
+       uint32_t argsz;
+       uint64_t start_addr;
+};
+
+struct vfio_iommu_spapr_tce_ddw_info {
+       uint64_t pgsizes;
+       uint32_t max_dynamic_windows_supported;
+       uint32_t levels;
+};
+
+/* SPAPR_v2 is not present, but SPAPR might be */
+#ifndef VFIO_SPAPR_TCE_IOMMU
+#define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
+
+struct vfio_iommu_spapr_tce_info {
+       uint32_t argsz;
+       uint32_t flags;
+       uint32_t dma32_window_start;
+       uint32_t dma32_window_size;
+       struct vfio_iommu_spapr_tce_ddw_info ddw;
+};
+#endif /* VFIO_SPAPR_TCE_IOMMU */
+
+#else /* VFIO_SPAPR_TCE_v2_IOMMU */
+#define RTE_VFIO_SPAPR VFIO_SPAPR_TCE_v2_IOMMU
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
 #define RTE_VFIO_NOIOMMU 8
 #else