All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Fleytman <dmitry@daynix.com>
To: P J P <ppandit@redhat.com>
Cc: Qemu Developers <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>, Li Qiang <liqiang6-s@360.cn>
Subject: Re: [Qemu-devel] [PATCH] scsi: pvscsi: limit process IO loop to maximum page count
Date: Tue, 13 Sep 2016 11:31:35 +0300	[thread overview]
Message-ID: <36CEB473-4A85-4C0E-AF37-668D3F21B373@daynix.com> (raw)
In-Reply-To: <alpine.LFD.2.20.1609131229220.27819@wniryva>

Hello Prasad,

Please see my questions inline.

> On 13 Sep 2016, at 10:00 AM, P J P <ppandit@redhat.com> wrote:
> 
> +-- On Wed, 7 Sep 2016, P J P wrote --+
> | From: Prasad J Pandit <pjp@fedoraproject.org>
> | 
> | Vmware Paravirtual SCSI emulator while processing IO requests
> | could run into an infinite loop if 'pvscsi_ring_pop_req_descr'
> | always returned positive value. Limit IO loop to the maximum

Do you see any specific scenario why this might happen?

> | page count.
> | 
> | Reported-by: Li Qiang <liqiang6-s@360.cn>
> | Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
> | ---
> |  hw/scsi/vmw_pvscsi.c | 4 +++-
> |  1 file changed, 3 insertions(+), 1 deletion(-)
> | 
> | diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
> | index babac5a..3e77a08 100644
> | --- a/hw/scsi/vmw_pvscsi.c
> | +++ b/hw/scsi/vmw_pvscsi.c
> | @@ -711,11 +711,13 @@ pvscsi_process_request_descriptor(PVSCSIState *s,
> |  static void
> |  pvscsi_process_io(PVSCSIState *s)
> |  {
> | +    int descr_pa_cnt = 0;
> |      PVSCSIRingReqDesc descr;
> |      hwaddr next_descr_pa;
> |  
> |      assert(s->rings_info_valid);
> | -    while ((next_descr_pa = pvscsi_ring_pop_req_descr(&s->rings)) != 0) {
> | +    while (((next_descr_pa = pvscsi_ring_pop_req_descr(&s->rings)) != 0)
> | +            && descr_pa_cnt++ < PVSCSI_SETUP_RINGS_MAX_NUM_PAGES) {

Why do you limit number of processed descriptors by maximal number of pages in data exchange ring?
What will happen to requests still waiting in the ring after this function exits?

Thanks,
Dmitry

> |  
> |          /* Only read after production index verification */
> |          smp_rmb();
> 
> Ping...!
> --
> Prasad J Pandit / Red Hat Product Security Team
> 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F

  reply	other threads:[~2016-09-13  8:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07  4:43 [Qemu-devel] [PATCH] scsi: pvscsi: limit process IO loop to maximum page count P J P
2016-09-13  7:00 ` P J P
2016-09-13  8:31   ` Dmitry Fleytman [this message]
2016-09-13 10:48     ` P J P
2016-09-13 12:10       ` Dmitry Fleytman
2016-09-13 13:09         ` 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=36CEB473-4A85-4C0E-AF37-668D3F21B373@daynix.com \
    --to=dmitry@daynix.com \
    --cc=liqiang6-s@360.cn \
    --cc=pbonzini@redhat.com \
    --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.