[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v4 14/20] vhost: Add vhost_svq_valid_device_features to shado
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH v4 14/20] vhost: Add vhost_svq_valid_device_features to shadow vq |
Date: |
Fri, 1 Oct 2021 09:05:57 +0200 |
This allows it to test if the guest has aknowledge an invalid transport
feature for SVQ. This will include packed vq layout, invalid descriptors
or event idx at the moment we start forwarding buffers.
We don't check for device features here since they will be re-negotiated
again. This allows SVQ to both use more advanced features of the device
when they are available and the guest is not capable of run them, and to
make SVQ compatible with future transport features.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.h | 2 ++
hw/virtio/vhost-shadow-virtqueue.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/hw/virtio/vhost-shadow-virtqueue.h
b/hw/virtio/vhost-shadow-virtqueue.h
index 2df3d117f5..b7baa424a7 100644
--- a/hw/virtio/vhost-shadow-virtqueue.h
+++ b/hw/virtio/vhost-shadow-virtqueue.h
@@ -14,6 +14,8 @@
typedef struct VhostShadowVirtqueue VhostShadowVirtqueue;
+bool vhost_svq_valid_device_features(uint64_t *features);
+
EventNotifier *vhost_svq_get_svq_call_notifier(VhostShadowVirtqueue *svq);
void vhost_svq_set_guest_call_notifier(VhostShadowVirtqueue *svq, int call_fd);
void vhost_svq_get_vring_addr(const VhostShadowVirtqueue *svq,
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index 5c1899f6af..34e159d4fd 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -46,6 +46,12 @@ typedef struct VhostShadowVirtqueue {
VirtIODevice *vdev;
} VhostShadowVirtqueue;
+/* If the device is using some of these, SVQ cannot communicate */
+bool vhost_svq_valid_device_features(uint64_t *dev_features)
+{
+ return true;
+}
+
/* Forward guest notifications */
static void vhost_handle_guest_kick(EventNotifier *n)
{
--
2.27.0
- Re: [RFC PATCH v4 11/20] vhost: Route host->guest notification through shadow virtqueue, (continued)
[RFC PATCH v4 12/20] virtio: Add vhost_shadow_vq_get_vring_addr, Eugenio Pérez, 2021/10/01
[RFC PATCH v4 13/20] vdpa: Save host and guest features, Eugenio Pérez, 2021/10/01
[RFC PATCH v4 14/20] vhost: Add vhost_svq_valid_device_features to shadow vq,
Eugenio Pérez <=
[RFC PATCH v4 15/20] vhost: Shadow virtqueue buffers forwarding, Eugenio Pérez, 2021/10/01
Re: [RFC PATCH v4 15/20] vhost: Shadow virtqueue buffers forwarding, Jason Wang, 2021/10/13
[RFC PATCH v4 16/20] vhost: Check for device VRING_USED_F_NO_NOTIFY at shadow virtqueue kick, Eugenio Pérez, 2021/10/01