qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: P J P <ppandit@redhat.com>
To: Dmitry Fleytman <dmitry@daynix.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 18:39:38 +0530 (IST)	[thread overview]
Message-ID: <alpine.LFD.2.20.1609131824410.31207@wniryva> (raw)
In-Reply-To: <60DE88ED-33CA-4050-9CB1-905930AC1A06@daynix.com>

+-- On Tue, 13 Sep 2016, Dmitry Fleytman wrote --+
| >  A guest user could set the 'ready_ptr' and 'PVSCSIRingInfo *mgr' parameter 
| > in 'pvscsi_ring_pop_req_descr', such that it always returns true.
| 
| I see. The problematic code is if (ready_ptr != mgr->consumed_ptr) {…}
| 
| mgr->consumed_ptr is managed by device and not visible to the driver,
| but ready_ptr is managed by driver and may be set to some “big” number.
| 
| In this case it may take a lot of iterations for consumed_ptr
| to become equal to ready_ptr and additionally some requests will be send multiple times.
| 
| The most straightforward way to fix this issue will be to
| check that ready_ptr - consumed_ptr is less than ring size.

  I see.

| I think you’re mixing concepts of number of
| pages in the ring and number of requests in the ring.
| 
| Each page contains (much) more than one request.

  I see, okay.

Thank you so much for the details. I'll send a revised patch.

Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F

      reply	other threads:[~2016-09-13 13:09 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
2016-09-13 10:48     ` P J P
2016-09-13 12:10       ` Dmitry Fleytman
2016-09-13 13:09         ` P J P [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=alpine.LFD.2.20.1609131824410.31207@wniryva \
    --to=ppandit@redhat.com \
    --cc=dmitry@daynix.com \
    --cc=liqiang6-s@360.cn \
    --cc=pbonzini@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 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).