qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: qemu-devel@nongnu.org, xen-devel@lists.xensource.com,
	konrad.wilk@oracle.com, kraxel@redhat.com,
	stefano.stabellini@eu.citrix.com
Subject: Re: [Qemu-devel] [PATCH v2 2/2] xen: add pvUSB backend
Date: Thu, 5 May 2016 11:13:55 +0100	[thread overview]
Message-ID: <20160505101355.GJ1885@perard.uk.xensource.com> (raw)
In-Reply-To: <5729B1DF.1070108@suse.com>

On Wed, May 04, 2016 at 10:25:03AM +0200, Juergen Gross wrote:
> On 03/05/16 17:06, Anthony PERARD wrote:
> > On Thu, Mar 10, 2016 at 04:19:30PM +0100, Juergen Gross wrote:
> >> +static void usbback_bh(void *opaque)
> >> +{
> >> +    struct usbback_info *usbif;
> >> +    struct usbif_urb_back_ring *urb_ring;
> >> +    struct usbback_req *usbback_req;
> >> +    RING_IDX rc, rp;
> >> +    unsigned int more_to_do;
> >> +
> >> +    usbif = opaque;
> >> +    if (usbif->ring_error) {
> >> +        return;
> >> +    }
> >> +
> >> +    urb_ring = &usbif->urb_ring;
> >> +    rc = urb_ring->req_cons;
> >> +    rp = urb_ring->sring->req_prod;
> > 
> > Maybe use atomic_read() here to avoid req_prod been read more than once.
> 
> Hmm. This isn't done in the other backends.
> 
> TBH: what would happen if req_prod would be read multiple times? In the
> worst case we would see a new request from the guest which we would have
> missed without the atomic_read().

If the guest is misbehaving, it maybe could provoke QEMU to handle more
request. I'm not sure.

For this use of atomic_read, I'm mostly refering to XSA-155[1] and a
conversation[2].

[1] http://xenbits.xen.org/xsa/advisory-155.html
[2] <570CFA45.7070504@citrix.com>
    http://lists.xen.org/archives/html/xen-devel/2016-04/msg01696.html


> >> +    xen_rmb(); /* Ensure we see queued requests up to 'rp'. */
> >> +

-- 
Anthony PERARD

  reply	other threads:[~2016-05-05 10:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 15:19 [Qemu-devel] [PATCH v2 0/2] usb, xen: add pvUSB backend Juergen Gross
2016-03-10 15:19 ` [Qemu-devel] [PATCH v2 1/2] xen: introduce dummy system device Juergen Gross
2016-05-03 15:11   ` Anthony PERARD
2016-03-10 15:19 ` [Qemu-devel] [PATCH v2 2/2] xen: add pvUSB backend Juergen Gross
2016-05-03 15:06   ` Anthony PERARD
2016-05-04  8:25     ` Juergen Gross
2016-05-05 10:13       ` Anthony PERARD [this message]
2016-05-06  4:57         ` Juergen Gross
2016-03-18 12:52 ` [Qemu-devel] [PATCH v2 0/2] usb, " Gerd Hoffmann
2016-03-18 14:47   ` Juergen Gross
2016-03-29  4:55     ` [Qemu-devel] [Xen-devel] " Juergen Gross

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=20160505101355.GJ1885@perard.uk.xensource.com \
    --to=anthony.perard@citrix.com \
    --cc=jgross@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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).