|
|
7f1c5b |
From 2906f8df3c5e915a3dc05a705b87990211f114b5 Mon Sep 17 00:00:00 2001
|
|
|
7f1c5b |
From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= <eperezma@redhat.com>
|
|
|
7f1c5b |
Date: Thu, 15 Dec 2022 12:31:34 +0100
|
|
|
7f1c5b |
Subject: [PATCH 02/14] vhost: set SVQ device call handler at SVQ start
|
|
|
7f1c5b |
MIME-Version: 1.0
|
|
|
7f1c5b |
Content-Type: text/plain; charset=UTF-8
|
|
|
7f1c5b |
Content-Transfer-Encoding: 8bit
|
|
|
7f1c5b |
|
|
|
7f1c5b |
RH-Author: Eugenio Pérez <eperezma@redhat.com>
|
|
|
7f1c5b |
RH-MergeRequest: 136: vDPA ASID support in Qemu
|
|
|
7f1c5b |
RH-Bugzilla: 2104412
|
|
|
7f1c5b |
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
7f1c5b |
RH-Acked-by: Cindy Lu <lulu@redhat.com>
|
|
|
7f1c5b |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7f1c5b |
RH-Commit: [2/13] ad90a6cc5c71b70d705904433d5a986e8fedb924 (eperezmartin/qemu-kvm)
|
|
|
7f1c5b |
|
|
|
7f1c5b |
By the end of this series CVQ is shadowed as long as the features
|
|
|
7f1c5b |
support it.
|
|
|
7f1c5b |
|
|
|
7f1c5b |
Since we don't know at the beginning of qemu running if this is
|
|
|
7f1c5b |
supported, move the event notifier handler setting to the start of the
|
|
|
7f1c5b |
SVQ, instead of the start of qemu run. This will avoid to create them if
|
|
|
7f1c5b |
the device does not support SVQ.
|
|
|
7f1c5b |
|
|
|
7f1c5b |
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
|
|
|
7f1c5b |
Acked-by: Jason Wang <jasowang@redhat.com>
|
|
|
7f1c5b |
Message-Id: <20221215113144.322011-3-eperezma@redhat.com>
|
|
|
7f1c5b |
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
7f1c5b |
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
7f1c5b |
(cherry picked from commit 20e7412bfd63c68f1798fbdb799aedb7e05fee88)
|
|
|
7f1c5b |
---
|
|
|
7f1c5b |
hw/virtio/vhost-shadow-virtqueue.c | 4 ++--
|
|
|
7f1c5b |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
7f1c5b |
|
|
|
7f1c5b |
diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c
|
|
|
7f1c5b |
index 5bd14cad96..264ddc166d 100644
|
|
|
7f1c5b |
--- a/hw/virtio/vhost-shadow-virtqueue.c
|
|
|
7f1c5b |
+++ b/hw/virtio/vhost-shadow-virtqueue.c
|
|
|
7f1c5b |
@@ -648,6 +648,7 @@ void vhost_svq_start(VhostShadowVirtqueue *svq, VirtIODevice *vdev,
|
|
|
7f1c5b |
{
|
|
|
7f1c5b |
size_t desc_size, driver_size, device_size;
|
|
|
7f1c5b |
|
|
|
7f1c5b |
+ event_notifier_set_handler(&svq->hdev_call, vhost_svq_handle_call);
|
|
|
7f1c5b |
svq->next_guest_avail_elem = NULL;
|
|
|
7f1c5b |
svq->shadow_avail_idx = 0;
|
|
|
7f1c5b |
svq->shadow_used_idx = 0;
|
|
|
7f1c5b |
@@ -704,6 +705,7 @@ void vhost_svq_stop(VhostShadowVirtqueue *svq)
|
|
|
7f1c5b |
g_free(svq->desc_state);
|
|
|
7f1c5b |
qemu_vfree(svq->vring.desc);
|
|
|
7f1c5b |
qemu_vfree(svq->vring.used);
|
|
|
7f1c5b |
+ event_notifier_set_handler(&svq->hdev_call, NULL);
|
|
|
7f1c5b |
}
|
|
|
7f1c5b |
|
|
|
7f1c5b |
/**
|
|
|
7f1c5b |
@@ -740,7 +742,6 @@ VhostShadowVirtqueue *vhost_svq_new(VhostIOVATree *iova_tree,
|
|
|
7f1c5b |
}
|
|
|
7f1c5b |
|
|
|
7f1c5b |
event_notifier_init_fd(&svq->svq_kick, VHOST_FILE_UNBIND);
|
|
|
7f1c5b |
- event_notifier_set_handler(&svq->hdev_call, vhost_svq_handle_call);
|
|
|
7f1c5b |
svq->iova_tree = iova_tree;
|
|
|
7f1c5b |
svq->ops = ops;
|
|
|
7f1c5b |
svq->ops_opaque = ops_opaque;
|
|
|
7f1c5b |
@@ -763,7 +764,6 @@ void vhost_svq_free(gpointer pvq)
|
|
|
7f1c5b |
VhostShadowVirtqueue *vq = pvq;
|
|
|
7f1c5b |
vhost_svq_stop(vq);
|
|
|
7f1c5b |
event_notifier_cleanup(&vq->hdev_kick);
|
|
|
7f1c5b |
- event_notifier_set_handler(&vq->hdev_call, NULL);
|
|
|
7f1c5b |
event_notifier_cleanup(&vq->hdev_call);
|
|
|
7f1c5b |
g_free(vq);
|
|
|
7f1c5b |
}
|
|
|
7f1c5b |
--
|
|
|
7f1c5b |
2.31.1
|
|
|
7f1c5b |
|