qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	Alexander Graf <agraf@suse.de>,
	Dominik Dingel <dingel@linux.vnet.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] s390-ccw.img: Fix waiting for virtio processing.
Date: Fri, 30 Aug 2013 10:38:35 +0200	[thread overview]
Message-ID: <52205A0B.1040606@redhat.com> (raw)
In-Reply-To: <1377849572-42883-2-git-send-email-cornelia.huck@de.ibm.com>

Il 30/08/2013 09:59, Cornelia Huck ha scritto:
> +    vr->used_idx = vr->used->idx;
> +    /*
> +     * Wait until the used index has moved.
> +     * Note: This is only race-free if the host doesn't start draining
> +     * the queue out of its own accord.
> +     */
> +    while (vr->used->idx == vr->used_idx) {

Can you instead initialize vr->used_idx in virtio_setup_block, and then
update it _after_ the while loop?  This would be race-free.

Paolo

      reply	other threads:[~2013-08-30  8:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-30  7:59 [Qemu-devel] [PATCH] s390-ccw: Fix ipl failure Cornelia Huck
2013-08-30  7:59 ` [Qemu-devel] [PATCH] s390-ccw.img: Fix waiting for virtio processing Cornelia Huck
2013-08-30  8:38   ` Paolo Bonzini [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=52205A0B.1040606@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=dingel@linux.vnet.ibm.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).