From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: peter.maydell@linaro.org, qemu-stable@nongnu.org,
qemu-devel@nongnu.org, stefanha@redhat.com,
Anthony Liguori <aliguori@amazon.com>
Subject: Re: [Qemu-devel] [PATCH] virtio: allow mapping up to max queue size
Date: Tue, 13 May 2014 09:57:26 +0100 [thread overview]
Message-ID: <20140513085725.GC2566@work-vm> (raw)
In-Reply-To: <1399885648-14985-1-git-send-email-mst@redhat.com>
* Michael S. Tsirkin (mst@redhat.com) wrote:
> It's a loop from i < num_sg and the array is VIRTQUEUE_MAX_SIZE - so
> it's OK if the value read is VIRTQUEUE_MAX_SIZE.
>
> Not a big problem in practice as people don't use
> such big queues, but it's inelegant.
>
> Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@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 7f4e7ec..3557c17 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -430,7 +430,7 @@ void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,
> unsigned int i;
> hwaddr len;
>
> - if (num_sg >= VIRTQUEUE_MAX_SIZE) {
> + if (num_sg > VIRTQUEUE_MAX_SIZE) {
> error_report("virtio: map attempt out of bounds: %zd > %d",
> num_sg, VIRTQUEUE_MAX_SIZE);
> exit(1);
> --
> MST
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2014-05-13 8:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-12 9:08 [Qemu-devel] [PATCH] virtio: allow mapping up to max queue size Michael S. Tsirkin
2014-05-13 8:57 ` Dr. David Alan Gilbert [this message]
2014-05-13 12:03 ` Stefan Hajnoczi
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=20140513085725.GC2566@work-vm \
--to=dgilbert@redhat.com \
--cc=aliguori@amazon.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=stefanha@redhat.com \
/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.