[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v3 19/29] vhost: Check for device VRING_USED_F_NO_NOTIFY at shadow
From: |
Eugenio Pérez |
Subject: |
[RFC v3 19/29] vhost: Check for device VRING_USED_F_NO_NOTIFY at shadow virtqueue kick |
Date: |
Wed, 19 May 2021 18:28:53 +0200 |
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/virtio/vhost-shadow-virtqueue.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index 6d767fe248..6b42147449 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b/hw/virtio/vhost-shadow-virtqueue.c
@@ -135,6 +135,15 @@ static void vhost_shadow_vq_add(VhostShadowVirtqueue *svq,
svq->ring_id_maps[qemu_head] = elem;
}
+static void vhost_shadow_vq_kick(VhostShadowVirtqueue *svq)
+{
+ /* Make sure we are reading updated device flag */
+ smp_rmb();
+ if (!(svq->vring.used->flags & VRING_USED_F_NO_NOTIFY)) {
+ event_notifier_set(&svq->kick_notifier);
+ }
+}
+
/* Handle guest->device notifications */
static void vhost_handle_guest_kick(EventNotifier *n)
{
@@ -159,7 +168,7 @@ static void vhost_handle_guest_kick(EventNotifier *n)
}
vhost_shadow_vq_add(svq, elem);
- event_notifier_set(&svq->kick_notifier);
+ vhost_shadow_vq_kick(svq);
}
virtio_queue_set_notification(svq->vq, true);
--
2.27.0
- [RFC v3 13/29] vhost: Add vhost_get_iova_range operation, (continued)
- [RFC v3 14/29] vhost: add vhost_has_limited_iova_range, Eugenio Pérez, 2021/05/19
- [RFC v3 15/29] vhost: Add enable_custom_iommu to VhostOps, Eugenio Pérez, 2021/05/19
- [RFC v3 16/29] vhost-vdpa: Add vhost_vdpa_enable_custom_iommu, Eugenio Pérez, 2021/05/19
- [RFC v3 17/29] vhost: Shadow virtqueue buffers forwarding, Eugenio Pérez, 2021/05/19
- [RFC v3 18/29] vhost: Use vhost_enable_custom_iommu to unmap everything if available, Eugenio Pérez, 2021/05/19
- [RFC v3 19/29] vhost: Check for device VRING_USED_F_NO_NOTIFY at shadow virtqueue kick,
Eugenio Pérez <=
- [RFC v3 20/29] vhost: Use VRING_AVAIL_F_NO_INTERRUPT at device call on shadow virtqueue, Eugenio Pérez, 2021/05/19
- [RFC v3 21/29] vhost: Add VhostIOVATree, Eugenio Pérez, 2021/05/19
- [RFC v3 22/29] vhost: Add iova_rev_maps_find_iova to IOVAReverseMaps, Eugenio Pérez, 2021/05/19
- [RFC v3 23/29] vhost: Use a tree to store memory mappings, Eugenio Pérez, 2021/05/19
- [RFC v3 24/29] vhost: Add iova_rev_maps_alloc, Eugenio Pérez, 2021/05/19
- [RFC v3 25/29] vhost: Add custom IOTLB translations to SVQ, Eugenio Pérez, 2021/05/19
- [RFC v3 26/29] vhost: Map in vdpa-dev, Eugenio Pérez, 2021/05/19
- [RFC v3 27/29] vhost-vdpa: Implement vhost_vdpa_vring_pause operation, Eugenio Pérez, 2021/05/19
- [RFC v3 28/29] vhost-vdpa: never map with vDPA listener, Eugenio Pérez, 2021/05/19