[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [RFC 1/7] linux-headers: partial update for VFIO reserved IOV
From: |
Eric Auger |
Subject: |
[Qemu-arm] [RFC 1/7] linux-headers: partial update for VFIO reserved IOVA registration |
Date: |
Wed, 27 Jan 2016 13:51:49 +0000 |
This is a partial update aiming at enhancing the VFIO user API
according to not yet upstreamed kernel developments available at:
https://git.linaro.org/people/eric.auger/linux.git/shortlog/refs/heads/v4.5-rc1-pcie-passthrough-v1
See https://lkml.org/lkml/2016/1/26/371 for more details.
Signed-off-by: Eric Auger <address@hidden>
---
linux-headers/linux/vfio.h | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h
index aa276bc..ac6032e 100644
--- a/linux-headers/linux/vfio.h
+++ b/linux-headers/linux/vfio.h
@@ -8,8 +8,8 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
-#ifndef VFIO_H
-#define VFIO_H
+#ifndef _UAPIVFIO_H
+#define _UAPIVFIO_H
#include <linux/types.h>
#include <linux/ioctl.h>
@@ -393,6 +393,7 @@ struct vfio_iommu_type1_info {
__u32 argsz;
__u32 flags;
#define VFIO_IOMMU_INFO_PGSIZES (1 << 0) /* supported page sizes info */
+#define VFIO_IOMMU_INFO_REQUIRE_MSI_MAP (1 << 1)/* MSI must be mapped */
__u64 iova_pgsizes; /* Bitmap of supported page sizes */
};
@@ -403,12 +404,20 @@ struct vfio_iommu_type1_info {
*
* Map process virtual addresses to IO virtual addresses using the
* provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.
+ *
+ * In case MSI_RESERVED_IOVA is set, the API only aims at registering an IOVA
+ * region which will be used on some platforms to map the host MSI frame.
+ * in that specific case, vaddr is ignored. The requirement for provisioning
+ * such IOVA range can be checked by calling VFIO_IOMMU_GET_INFO with the
+ * VFIO_IOMMU_INFO_REQUIRE_MSI_MAP attribute.
*/
struct vfio_iommu_type1_dma_map {
__u32 argsz;
__u32 flags;
#define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device
*/
#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */
+/* reserved iova for MSI vectors*/
+#define VFIO_DMA_MAP_FLAG_MSI_RESERVED_IOVA (1 << 2)
__u64 vaddr; /* Process virtual address */
__u64 iova; /* IO virtual address */
__u64 size; /* Size of mapping (bytes) */
@@ -591,4 +600,4 @@ struct vfio_iommu_spapr_tce_remove {
/* ***************************************************************** */
-#endif /* VFIO_H */
+#endif /* _UAPIVFIO_H */
--
1.9.1
- [Qemu-arm] [RFC 0/7] KVM PCI/MSI passthrough with mach-virt, Eric Auger, 2016/01/27
- [Qemu-arm] [RFC 1/7] linux-headers: partial update for VFIO reserved IOVA registration,
Eric Auger <=
- [Qemu-arm] [RFC 2/7] Add a function to determine interrupt number for INTx routing, Eric Auger, 2016/01/27
- [Qemu-arm] [RFC 3/7] Generic PCIe host bridge INTx determination for INTx routing, Eric Auger, 2016/01/27
- [Qemu-arm] [RFC 4/7] hw: vfio: common: introduce vfio_register_reserved_iova, Eric Auger, 2016/01/27
- [Qemu-arm] [RFC 5/7] memory: add reserved_iova region type, Eric Auger, 2016/01/27
- [Qemu-arm] [RFC 6/7] hw: arm: virt: register reserved IOVA region, Eric Auger, 2016/01/27
- [Qemu-arm] [RFC 7/7] hw: vfio: common: adapt vfio_listeners for reserved_iova region, Eric Auger, 2016/01/27