All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio: check for vring setup in virtio_queue_empty
@ 2017-02-23  8:51 Paolo Bonzini
  2017-02-23 10:30 ` Laszlo Ersek
  2017-02-27 15:39 ` Cornelia Huck
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2017-02-23  8:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: kraxel, alex.williamson, lersek, mst

If the vring has not been set up, there is nothing in the virtqueue.
virtio_queue_host_notifier_aio_poll calls virtio_queue_empty even in
this case; we have to filter it out just like virtio_queue_notify_aio_vq.

Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/virtio/virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 23483c7..e487e36 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2291,7 +2291,7 @@ static bool virtio_queue_host_notifier_aio_poll(void *opaque)
     VirtQueue *vq = container_of(n, VirtQueue, host_notifier);
     bool progress;
 
-    if (virtio_queue_empty(vq)) {
+    if (!vq->vring.desc || virtio_queue_empty(vq)) {
         return false;
     }
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio: check for vring setup in virtio_queue_empty
  2017-02-23  8:51 [Qemu-devel] [PATCH] virtio: check for vring setup in virtio_queue_empty Paolo Bonzini
@ 2017-02-23 10:30 ` Laszlo Ersek
  2017-02-27 15:39 ` Cornelia Huck
  1 sibling, 0 replies; 3+ messages in thread
From: Laszlo Ersek @ 2017-02-23 10:30 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: kraxel, alex.williamson, mst

On 02/23/17 09:51, Paolo Bonzini wrote:
> If the vring has not been set up, there is nothing in the virtqueue.
> virtio_queue_host_notifier_aio_poll calls virtio_queue_empty even in
> this case; we have to filter it out just like virtio_queue_notify_aio_vq.
> 
> Reported-by: Gerd Hoffmann <kraxel@redhat.com>
> Tested-by: Alex Williamson <alex.williamson@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/virtio/virtio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 23483c7..e487e36 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -2291,7 +2291,7 @@ static bool virtio_queue_host_notifier_aio_poll(void *opaque)
>      VirtQueue *vq = container_of(n, VirtQueue, host_notifier);
>      bool progress;
>  
> -    if (virtio_queue_empty(vq)) {
> +    if (!vq->vring.desc || virtio_queue_empty(vq)) {
>          return false;
>      }
>  
> 

Tested-by: Laszlo Ersek <lersek@redhat.com>

Thanks!
Laszlo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio: check for vring setup in virtio_queue_empty
  2017-02-23  8:51 [Qemu-devel] [PATCH] virtio: check for vring setup in virtio_queue_empty Paolo Bonzini
  2017-02-23 10:30 ` Laszlo Ersek
@ 2017-02-27 15:39 ` Cornelia Huck
  1 sibling, 0 replies; 3+ messages in thread
From: Cornelia Huck @ 2017-02-27 15:39 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, alex.williamson, lersek, kraxel, mst

On Thu, 23 Feb 2017 09:51:30 +0100
Paolo Bonzini <pbonzini@redhat.com> wrote:

> If the vring has not been set up, there is nothing in the virtqueue.
> virtio_queue_host_notifier_aio_poll calls virtio_queue_empty even in
> this case; we have to filter it out just like virtio_queue_notify_aio_vq.
> 
> Reported-by: Gerd Hoffmann <kraxel@redhat.com>
> Tested-by: Alex Williamson <alex.williamson@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/virtio/virtio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 23483c7..e487e36 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -2291,7 +2291,7 @@ static bool virtio_queue_host_notifier_aio_poll(void *opaque)
>      VirtQueue *vq = container_of(n, VirtQueue, host_notifier);
>      bool progress;
> 
> -    if (virtio_queue_empty(vq)) {
> +    if (!vq->vring.desc || virtio_queue_empty(vq)) {
>          return false;
>      }
> 

Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>

...although it is not sufficient...

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-27 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-23  8:51 [Qemu-devel] [PATCH] virtio: check for vring setup in virtio_queue_empty Paolo Bonzini
2017-02-23 10:30 ` Laszlo Ersek
2017-02-27 15:39 ` Cornelia Huck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.