[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 05/20] VFIO: add new IOCTL for svm bind tasks
From: |
Liu, Yi L |
Subject: |
[Qemu-devel] [RFC PATCH 05/20] VFIO: add new IOCTL for svm bind tasks |
Date: |
Wed, 26 Apr 2017 18:06:35 +0800 |
Add a new IOCTL cmd VFIO_IOMMU_SVM_BIND_TASK attached on container->fd.
On VT-d, this IOCTL cmd would be used to link the guest PASID page table
to host. While for other vendors, it may also be used to support other
kind of SVM bind request. Previously, there is a discussion on it with
ARM engineer. It can be found by the link below. This IOCTL cmd may
support SVM PASID bind request from userspace driver, or page table(cr3)
bind request from guest. These SVM bind requests would be supported by
adding different flags. e.g. VFIO_SVM_BIND_PASID is added to support
PASID bind from userspace driver, VFIO_SVM_BIND_PGTABLE is added to
support page table bind from guest.
https://patchwork.kernel.org/patch/9594231/
Signed-off-by: Liu, Yi L <address@hidden>
---
linux-headers/linux/vfio.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h
index 759b850..9848d63 100644
--- a/linux-headers/linux/vfio.h
+++ b/linux-headers/linux/vfio.h
@@ -537,6 +537,24 @@ struct vfio_iommu_type1_dma_unmap {
#define VFIO_IOMMU_ENABLE _IO(VFIO_TYPE, VFIO_BASE + 15)
#define VFIO_IOMMU_DISABLE _IO(VFIO_TYPE, VFIO_BASE + 16)
+/* IOCTL for Shared Virtual Memory Bind */
+struct vfio_device_svm {
+ __u32 argsz;
+#define VFIO_SVM_BIND_PASIDTBL (1 << 0) /* Bind PASID Table */
+#define VFIO_SVM_BIND_PASID (1 << 1) /* Bind PASID from userspace driver */
+#define VFIO_SVM_BIND_PGTABLE (1 << 2) /* Bind guest mmu page table */
+ __u32 flags;
+ __u32 length;
+ __u8 data[];
+};
+
+#define VFIO_SVM_TYPE_MASK (VFIO_SVM_BIND_PASIDTBL | \
+ VFIO_SVM_BIND_PASID | \
+ VFIO_SVM_BIND_PGTABLE )
+
+#define VFIO_IOMMU_SVM_BIND_TASK _IO(VFIO_TYPE, VFIO_BASE + 22)
+
+
/* -------- Additional API for SPAPR TCE (Server POWERPC) IOMMU -------- */
/*
--
1.9.1
- [Qemu-devel] [RFC PATCH 00/20] Qemu: Extend intel_iommu emulator to support Shared Virtual Memory, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 01/20] intel_iommu: add "ecs" option, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 02/20] intel_iommu: exposed extended-context mode to guest, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 03/20] intel_iommu: add "svm" option, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 04/20] Memory: modify parameter in IOMMUNotifier func, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 05/20] VFIO: add new IOCTL for svm bind tasks,
Liu, Yi L <=
- [Qemu-devel] [RFC PATCH 06/20] VFIO: add new notifier for binding PASID table, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 07/20] VFIO: check notifier flag in region_del(), Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 08/20] Memory: add notifier flag check in memory_replay(), Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 09/20] Memory: introduce iommu_ops->record_device, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 10/20] VFIO: notify vIOMMU emulator when device is assigned, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 11/20] intel_iommu: provide iommu_ops->record_device, Liu, Yi L, 2017/04/26
- [Qemu-devel] [RFC PATCH 12/20] Memory: Add func to fire pasidt_bind notifier, Liu, Yi L, 2017/04/26