All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: P J P <ppandit@redhat.com>
Cc: Qemu Developers <qemu-devel@nongnu.org>,
	Dmitry Fleytman <dmitry@daynix.com>, Li Qiang <liqiang6-s@360.cn>
Subject: Re: [Qemu-devel] [PATCH] scsi: pvscsi: request descriptor data_length to 32 bit
Date: Mon, 5 Sep 2016 13:39:29 +0200	[thread overview]
Message-ID: <c1eca7af-a918-8938-6d7e-dacf74e35c80@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.20.1609051600210.15714@wniryva>



On 05/09/2016 13:13, P J P wrote:
> +-- On Mon, 5 Sep 2016, Paolo Bonzini wrote --+
> | No, that's not what happens.  chunk_size is set to sg.resid, after which:
> | 
> |         sg.dataAddr += chunk_size;
> |         data_length -= chunk_size;
> |         sg.resid -= chunk_size;
> | 
> | The loop is reentered with sg.resid == 0, it calls into
> | pvscsi_get_next_sg_elem and this sets sg.resid to a nonzero value.  It's
> | not an infinite loop.
> 
>   Yes, true; But 'pvscsi_get_next_sg_elem' does not return non-zero 'sg.resid' 
> each time. In fact, it returns more zeros and thus the loop iterates 
> infinitely. When I ran it with 64 bit 'data_length' and without cast, after 
> some time, the inner loop gets stuck and does not seem to read non-zero values 
> into 'sg.resid'.

pvscsi_get_next_sg_elem just reads 16 bytes from guest RAM, so I guess
that's because you didn't set up the SG list correctly.  QEMU indeed
doesn't check for that, but that's a different bug.

> Is there limit to number of SG elements?

Without a public spec it's hard, but I guess 2048 is more than enough.

Paolo

  reply	other threads:[~2016-09-05 11:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-03  6:33 [Qemu-devel] [PATCH] scsi: pvscsi: request descriptor data_length to 32 bit P J P
2016-09-05  9:04 ` Paolo Bonzini
2016-09-05  9:50   ` P J P
2016-09-05 10:00     ` Paolo Bonzini
2016-09-05 11:13       ` P J P
2016-09-05 11:39         ` Paolo Bonzini [this message]
2016-09-05 12:58           ` P J P
2016-09-05 13:02             ` Paolo Bonzini
2016-09-05 20:52               ` P J P

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=c1eca7af-a918-8938-6d7e-dacf74e35c80@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dmitry@daynix.com \
    --cc=liqiang6-s@360.cn \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@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 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.