From: "Michael S. Tsirkin" <mst@redhat.com>
To: Yury Kotov <yury-kotov@yandex-team.ru>
Cc: qemu-devel@nongnu.org, wrfsh@yandex-team.ru, Jia He <hejianet@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] vhost: fix invalid downcast
Date: Fri, 13 Jul 2018 19:15:56 +0300 [thread overview]
Message-ID: <20180713191451-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1531490645-10989-1-git-send-email-yury-kotov@yandex-team.ru>
On Fri, Jul 13, 2018 at 05:04:05PM +0300, Yury Kotov wrote:
> virtio_queue_get_desc_addr returns 64-bit hwaddr while int is usually 32-bit.
> If returned hwaddr is not equal to 0 but least-significant 32 bits are
> equal to 0 then this code will not actually stop running queue.
>
> Signed-off-by: Yury Kotov <yury-kotov@yandex-team.ru>
So IIUC
Fixes: fb20fbb764aa1 ("vhost: avoid to start/stop virtqueue which is not ready")
And
Cc: qemu-stable@nongnu.org
> ---
> hw/virtio/vhost.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index b129cb9..7edeee7 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -1071,10 +1071,8 @@ static void vhost_virtqueue_stop(struct vhost_dev *dev,
> .index = vhost_vq_index,
> };
> int r;
> - int a;
>
> - a = virtio_queue_get_desc_addr(vdev, idx);
> - if (a == 0) {
> + if (virtio_queue_get_desc_addr(vdev, idx) == 0) {
> /* Don't stop the virtqueue which might have not been started */
> return;
> }
> --
> 2.7.4
next prev parent reply other threads:[~2018-07-13 16:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 14:04 [Qemu-devel] [PATCH] vhost: fix invalid downcast Yury Kotov
2018-07-13 16:15 ` Michael S. Tsirkin [this message]
2018-07-14 4:09 ` Jia He
2018-07-16 9:58 ` Юрий Котов
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180713191451-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=hejianet@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=wrfsh@yandex-team.ru \
--cc=yury-kotov@yandex-team.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.