All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH-for-5.1] libvhost-user: Report descriptor index on panic
@ 2020-07-23 17:19 Philippe Mathieu-Daudé
  2020-07-23 17:56 ` Marc-André Lureau
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-23 17:19 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Raphael Norwitz,
	Philippe Mathieu-Daudé,
	Stefan Hajnoczi, Michael S . Tsirkin

We want to report the index of the descriptor,
not its pointer.

Fixes: 7b2e5c65f4 ("contrib: add libvhost-user")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 contrib/libvhost-user/libvhost-user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index d315db1396..53f16bdf08 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -2074,7 +2074,7 @@ virtqueue_get_head(VuDev *dev, VuVirtq *vq,
 
     /* If their number is silly, that's a fatal mistake. */
     if (*head >= vq->vring.num) {
-        vu_panic(dev, "Guest says index %u is available", head);
+        vu_panic(dev, "Guest says index %u is available", *head);
         return false;
     }
 
@@ -2133,7 +2133,7 @@ virtqueue_read_next_desc(VuDev *dev, struct vring_desc *desc,
     smp_wmb();
 
     if (*next >= max) {
-        vu_panic(dev, "Desc next is %u", next);
+        vu_panic(dev, "Desc next is %u", *next);
         return VIRTQUEUE_READ_DESC_ERROR;
     }
 
-- 
2.21.3



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

* Re: [PATCH-for-5.1] libvhost-user: Report descriptor index on panic
  2020-07-23 17:19 [PATCH-for-5.1] libvhost-user: Report descriptor index on panic Philippe Mathieu-Daudé
@ 2020-07-23 17:56 ` Marc-André Lureau
  2020-07-23 18:00 ` Raphael Norwitz
  2020-07-24 13:50 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Marc-André Lureau @ 2020-07-23 17:56 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Raphael Norwitz, qemu-devel, Stefan Hajnoczi, Michael S . Tsirkin

On Thu, Jul 23, 2020 at 9:19 PM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> We want to report the index of the descriptor,
> not its pointer.
>
> Fixes: 7b2e5c65f4 ("contrib: add libvhost-user")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  contrib/libvhost-user/libvhost-user.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
> index d315db1396..53f16bdf08 100644
> --- a/contrib/libvhost-user/libvhost-user.c
> +++ b/contrib/libvhost-user/libvhost-user.c
> @@ -2074,7 +2074,7 @@ virtqueue_get_head(VuDev *dev, VuVirtq *vq,
>
>      /* If their number is silly, that's a fatal mistake. */
>      if (*head >= vq->vring.num) {
> -        vu_panic(dev, "Guest says index %u is available", head);
> +        vu_panic(dev, "Guest says index %u is available", *head);
>          return false;
>      }
>
> @@ -2133,7 +2133,7 @@ virtqueue_read_next_desc(VuDev *dev, struct vring_desc *desc,
>      smp_wmb();
>
>      if (*next >= max) {
> -        vu_panic(dev, "Desc next is %u", next);
> +        vu_panic(dev, "Desc next is %u", *next);
>          return VIRTQUEUE_READ_DESC_ERROR;
>      }
>
> --
> 2.21.3
>



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

* Re: [PATCH-for-5.1] libvhost-user: Report descriptor index on panic
  2020-07-23 17:19 [PATCH-for-5.1] libvhost-user: Report descriptor index on panic Philippe Mathieu-Daudé
  2020-07-23 17:56 ` Marc-André Lureau
@ 2020-07-23 18:00 ` Raphael Norwitz
  2020-07-24 13:50 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Raphael Norwitz @ 2020-07-23 18:00 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Marc-André Lureau, Michael S . Tsirkin, QEMU,
	Stefan Hajnoczi, Raphael Norwitz

On Thu, Jul 23, 2020 at 11:20 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> We want to report the index of the descriptor,
> not its pointer.
>
> Fixes: 7b2e5c65f4 ("contrib: add libvhost-user")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>

> ---
>  contrib/libvhost-user/libvhost-user.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
> index d315db1396..53f16bdf08 100644
> --- a/contrib/libvhost-user/libvhost-user.c
> +++ b/contrib/libvhost-user/libvhost-user.c
> @@ -2074,7 +2074,7 @@ virtqueue_get_head(VuDev *dev, VuVirtq *vq,
>
>      /* If their number is silly, that's a fatal mistake. */
>      if (*head >= vq->vring.num) {
> -        vu_panic(dev, "Guest says index %u is available", head);
> +        vu_panic(dev, "Guest says index %u is available", *head);
>          return false;
>      }
>
> @@ -2133,7 +2133,7 @@ virtqueue_read_next_desc(VuDev *dev, struct vring_desc *desc,
>      smp_wmb();
>
>      if (*next >= max) {
> -        vu_panic(dev, "Desc next is %u", next);
> +        vu_panic(dev, "Desc next is %u", *next);
>          return VIRTQUEUE_READ_DESC_ERROR;
>      }
>
> --
> 2.21.3
>
>


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

* Re: [PATCH-for-5.1] libvhost-user: Report descriptor index on panic
  2020-07-23 17:19 [PATCH-for-5.1] libvhost-user: Report descriptor index on panic Philippe Mathieu-Daudé
  2020-07-23 17:56 ` Marc-André Lureau
  2020-07-23 18:00 ` Raphael Norwitz
@ 2020-07-24 13:50 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2020-07-24 13:50 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Marc-André Lureau, Raphael Norwitz, qemu-devel, Michael S . Tsirkin

[-- Attachment #1: Type: text/plain, Size: 424 bytes --]

On Thu, Jul 23, 2020 at 07:19:35PM +0200, Philippe Mathieu-Daudé wrote:
> We want to report the index of the descriptor,
> not its pointer.
> 
> Fixes: 7b2e5c65f4 ("contrib: add libvhost-user")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  contrib/libvhost-user/libvhost-user.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2020-07-24 13:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23 17:19 [PATCH-for-5.1] libvhost-user: Report descriptor index on panic Philippe Mathieu-Daudé
2020-07-23 17:56 ` Marc-André Lureau
2020-07-23 18:00 ` Raphael Norwitz
2020-07-24 13:50 ` Stefan Hajnoczi

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.