From: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-stable@nongnu.org, qemu-devel@nongnu.org,
Anthony Liguori <aliguori@amazon.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] [PULL] virtio: allow mapping up to max queue size
Date: Tue, 13 May 2014 18:47:47 +0300 [thread overview]
Message-ID: <1399996067.29925.69.camel@localhost.localdomain> (raw)
In-Reply-To: <1399995730-28956-2-git-send-email-mst@redhat.com>
On Tue, 2014-05-13 at 18:42 +0300, Michael S. Tsirkin 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>
> ---
> 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);
ACK
Thanks,
Marcel
prev parent reply other threads:[~2014-05-13 15:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-13 15:42 [Qemu-devel] [PULL] virtio update Michael S. Tsirkin
2014-05-13 15:42 ` [Qemu-devel] [PULL] virtio: allow mapping up to max queue size Michael S. Tsirkin
2014-05-13 15:47 ` Marcel Apfelbaum [this message]
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=1399996067.29925.69.camel@localhost.localdomain \
--to=marcel.apfelbaum@gmail.com \
--cc=aliguori@amazon.com \
--cc=dgilbert@redhat.com \
--cc=marcel.a@redhat.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).