[PATCH 2/4] virtio-mmio: stop ioeventfd on legacy reset

Paolo Bonzini posted 4 patches 3 years, 8 months ago
Maintainers: Cornelia Huck <cohuck@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, "Michael S. Tsirkin" <mst@redhat.com>, Thomas Huth <thuth@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, David Hildenbrand <david@redhat.com>, Christian Borntraeger <borntraeger@linux.ibm.com>
[PATCH 2/4] virtio-mmio: stop ioeventfd on legacy reset
Posted by Paolo Bonzini 3 years, 8 months ago
If the queue PFN is set to zero on a virtio-mmio device, the device is reset.
In that case however the virtio_bus_stop_ioeventfd function was not
called; add it so that the behavior is similar to when status is set to 0.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/virtio/virtio-mmio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c
index 688eccda94..41a35d31c8 100644
--- a/hw/virtio/virtio-mmio.c
+++ b/hw/virtio/virtio-mmio.c
@@ -376,6 +376,7 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value,
             return;
         }
         if (value == 0) {
+            virtio_mmio_stop_ioeventfd(proxy);
             virtio_reset(vdev);
         } else {
             virtio_queue_set_addr(vdev, vdev->queue_sel,
-- 
2.36.1
Re: [PATCH 2/4] virtio-mmio: stop ioeventfd on legacy reset
Posted by Cornelia Huck 3 years, 8 months ago
On Thu, Jun 09 2022, Paolo Bonzini <pbonzini@redhat.com> wrote:

> If the queue PFN is set to zero on a virtio-mmio device, the device is reset.
> In that case however the virtio_bus_stop_ioeventfd function was not
> called; add it so that the behavior is similar to when status is set to 0.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/virtio/virtio-mmio.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>