[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC V1 4/7] vdpa/cpr: kernel interfaces
From: |
Steve Sistare |
Subject: |
[RFC V1 4/7] vdpa/cpr: kernel interfaces |
Date: |
Fri, 12 Jul 2024 07:02:08 -0700 |
Add the proposed vdpa kernel interfaces for CPR:
VHOST_NEW_OWNER: new ioctl
VHOST_BACKEND_F_NEW_OWNER: new capability
VHOST_IOTLB_REMAP: new iotlb message
VHOST_BACKEND_F_IOTLB_REMAP: new capability
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
---
include/standard-headers/linux/vhost_types.h | 7 +++++++
linux-headers/linux/vhost.h | 9 +++++++++
2 files changed, 16 insertions(+)
diff --git a/include/standard-headers/linux/vhost_types.h
b/include/standard-headers/linux/vhost_types.h
index fd54044936..fa605ee1da 100644
--- a/include/standard-headers/linux/vhost_types.h
+++ b/include/standard-headers/linux/vhost_types.h
@@ -87,6 +87,7 @@ struct vhost_iotlb_msg {
*/
#define VHOST_IOTLB_BATCH_BEGIN 5
#define VHOST_IOTLB_BATCH_END 6
+#define VHOST_IOTLB_REMAP 7
uint8_t type;
};
@@ -193,4 +194,10 @@ struct vhost_vdpa_iova_range {
/* IOTLB don't flush memory mapping across device reset */
#define VHOST_BACKEND_F_IOTLB_PERSIST 0x8
+/* Supports VHOST_NEW_OWNER */
+#define VHOST_BACKEND_F_NEW_OWNER 0x9
+
+/* Supports VHOST_IOTLB_REMAP */
+#define VHOST_BACKEND_F_IOTLB_REMAP 0xa
+
#endif
diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h
index b95dd84eef..6c008c956a 100644
--- a/linux-headers/linux/vhost.h
+++ b/linux-headers/linux/vhost.h
@@ -123,6 +123,15 @@
#define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
+/* Set current process as the new owner of this file descriptor. The fd must
+ * already be owned, via a prior call to VHOST_SET_OWNER. The pinned memory
+ * count is transferred from the previous to the new owner.
+ * Errors:
+ * EINVAL: not owned
+ * EBUSY: caller is already the owner
+ * ENOMEM: RLIMIT_MEMLOCK exceeded
+ */
+#define VHOST_NEW_OWNER _IO(VHOST_VIRTIO, 0x27)
/* VHOST_NET specific defines */
/* Attach virtio net ring to a raw socket, or tap device.
--
2.39.3
- [RFC V1 0/7] Live update: vdpa, Steve Sistare, 2024/07/12
- [RFC V1 5/7] vdpa/cpr: use VHOST_NEW_OWNER, Steve Sistare, 2024/07/12
- [RFC V1 1/7] migration: cpr_needed_for_reuse, Steve Sistare, 2024/07/12
- [RFC V1 6/7] vdpa/cpr: pass shadow parameter to dma functions, Steve Sistare, 2024/07/12
- [RFC V1 7/7] vdpa/cpr: preserve dma mappings, Steve Sistare, 2024/07/12
- [RFC V1 4/7] vdpa/cpr: kernel interfaces,
Steve Sistare <=
- [RFC V1 2/7] migration: skip dirty memory tracking for cpr, Steve Sistare, 2024/07/12
- [RFC V1 3/7] vdpa/cpr: preserve device fd, Steve Sistare, 2024/07/12