From: Amos Kong <akong@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>,
qemu-devel@nongnu.org, qemu-stable@nongnu.org,
yinyin <yin.yin@cs2c.com.cn>,
Stefan Hajnoczi <stefanha@redhat.com>,
amit.shah@redhat.com
Subject: Re: [Qemu-devel] [PULL 14/14] virtio: virtqueue_get_avail_bytes: fix desc_pa when loop over the indirect descriptor table
Date: Wed, 28 Aug 2013 17:24:53 +0800 [thread overview]
Message-ID: <20130828092453.GA6551@amosk.info> (raw)
In-Reply-To: <1377535318-30491-15-git-send-email-mst@redhat.com>
On Mon, Aug 26, 2013 at 07:43:41PM +0300, Michael S. Tsirkin wrote:
> From: yinyin <yin.yin@cs2c.com.cn>
>
> virtqueue_get_avail_bytes: when found a indirect desc, we need loop over it.
> /* loop over the indirect descriptor table */
> indirect = 1;
> max = vring_desc_len(desc_pa, i) / sizeof(VRingDesc);
> num_bufs = i = 0;
> desc_pa = vring_desc_addr(desc_pa, i);
> But, It init i to 0, then use i to update desc_pa. so we will always get:
> desc_pa = vring_desc_addr(desc_pa, 0);
> the last two line should swap.
>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Yin Yin <yin.yin@cs2c.com.cn>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Amos Kong <akong@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 f03c45d..2f1e73b 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -377,8 +377,8 @@ void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
> /* loop over the indirect descriptor table */
> indirect = 1;
> max = vring_desc_len(desc_pa, i) / sizeof(VRingDesc);
> - num_bufs = i = 0;
> desc_pa = vring_desc_addr(desc_pa, i);
> + num_bufs = i = 0;
> }
>
> do {
> --
> MST
>
--
Amos.
prev parent reply other threads:[~2013-08-28 9:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-26 16:42 [Qemu-devel] [PULL 00/14] pc,pci,virtio fixes and cleanups Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 01/14] pc: cleanup 1.4 compat support Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 02/14] arch_init: align MR size to target page size Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 03/14] loader: store FW CFG ROM files in RAM Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 04/14] q35: Add PCIe switch to example q35 configuration Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 05/14] sun4: Don't prematurely explode QEMUMachineInitArgs Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 06/14] ppc: Don't explode QEMUMachineInitArgs into local variables needlessly Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 07/14] ppc: Don't duplicate QEMUMachineInitArgs in PPCE500Params Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 08/14] pc: Don't prematurely explode QEMUMachineInitArgs Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 09/14] pc: Don't explode QEMUMachineInitArgs into local variables needlessly Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 10/14] pc: Kill pc_init_pci_1_0() Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 11/14] pc: Create pc_compat_*() functions Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 12/14] pc: pc_compat_1_4() now can call pc_compat_1_5() Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 13/14] pc_piix: Kill pc_init1() memory region args Michael S. Tsirkin
2013-08-26 16:43 ` [Qemu-devel] [PULL 14/14] virtio: virtqueue_get_avail_bytes: fix desc_pa when loop over the indirect descriptor table Michael S. Tsirkin
2013-08-28 9:24 ` Amos Kong [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=20130828092453.GA6551@amosk.info \
--to=akong@redhat.com \
--cc=amit.shah@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=stefanha@redhat.com \
--cc=yin.yin@cs2c.com.cn \
/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).