[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 06/27] virtio: Add virtio_queue_get_used_notify_split
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH 06/27] virtio: Add virtio_queue_get_used_notify_split |
Date: |
Fri, 20 Nov 2020 19:50:44 +0100 |
This function is just used for a few commits, so SW LM is developed
incrementally, and it is deleted after it is useful.
For a few commits, only the events (irqfd, eventfd) are forwarded.
This series adds descriptors forwarding on top of that.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
include/hw/virtio/virtio.h | 1 +
hw/virtio/virtio.c | 14 ++++++++++++++
2 files changed, 15 insertions(+)
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index b7ece7a6a8..b9b8497ea0 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -225,6 +225,7 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f, int
version_id);
void virtio_notify_config(VirtIODevice *vdev);
+bool virtio_queue_get_used_notify_split(VirtQueue *vq);
bool virtio_queue_get_notification(VirtQueue *vq);
void virtio_queue_set_notification(VirtQueue *vq, int enable);
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index ceb58fda6c..3469946538 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -377,6 +377,20 @@ static inline void vring_used_idx_set(VirtQueue *vq,
uint16_t val)
vq->used_idx = val;
}
+bool virtio_queue_get_used_notify_split(VirtQueue *vq)
+{
+ VRingMemoryRegionCaches *caches;
+ hwaddr pa = offsetof(VRingUsed, flags);
+ uint16_t flags;
+
+ RCU_READ_LOCK_GUARD();
+
+ caches = vring_get_region_caches(vq);
+ assert(caches);
+ flags = virtio_lduw_phys_cached(vq->vdev, &caches->used, pa);
+ return !(VRING_USED_F_NO_NOTIFY & flags);
+}
+
/* Called within rcu_read_lock(). */
static inline void vring_used_flags_set_bit(VirtQueue *vq, int mask)
{
--
2.18.4
- [RFC PATCH 00/27] vDPA software assisted live migration, Eugenio Pérez, 2020/11/20
- [RFC PATCH 01/27] vhost: Add vhost_dev_can_log, Eugenio Pérez, 2020/11/20
- [RFC PATCH 02/27] vhost: Add device callback in vhost_migration_log, Eugenio Pérez, 2020/11/20
- [RFC PATCH 03/27] vhost: Move log resize/put to vhost_dev_set_log, Eugenio Pérez, 2020/11/20
- [RFC PATCH 04/27] vhost: add vhost_kernel_set_vring_enable, Eugenio Pérez, 2020/11/20
- [RFC PATCH 05/27] vhost: Add hdev->dev.sw_lm_vq_handler, Eugenio Pérez, 2020/11/20
- [RFC PATCH 06/27] virtio: Add virtio_queue_get_used_notify_split,
Eugenio Pérez <=
- [RFC PATCH 07/27] vhost: Route guest->host notification through qemu, Eugenio Pérez, 2020/11/20
- [RFC PATCH 08/27] vhost: Add a flag for software assisted Live Migration, Eugenio Pérez, 2020/11/20
- [RFC PATCH 09/27] vhost: Route host->guest notification through qemu, Eugenio Pérez, 2020/11/20
- [RFC PATCH 10/27] vhost: Allocate shadow vring, Eugenio Pérez, 2020/11/20
- [RFC PATCH 11/27] virtio: const-ify all virtio_tswap* functions, Eugenio Pérez, 2020/11/20
- [RFC PATCH 12/27] virtio: Add virtio_queue_full, Eugenio Pérez, 2020/11/20
- [RFC PATCH 13/27] vhost: Send buffers to device, Eugenio Pérez, 2020/11/20
- [RFC PATCH 14/27] virtio: Remove virtio_queue_get_used_notify_split, Eugenio Pérez, 2020/11/20
- [RFC PATCH 15/27] vhost: Do not invalidate signalled used, Eugenio Pérez, 2020/11/20
- [RFC PATCH 16/27] virtio: Expose virtqueue_alloc_element, Eugenio Pérez, 2020/11/20