kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <levinsasha928@gmail.com>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: penberg@kernel.org, kvm@vger.kernel.org, mingo@elte.hu,
	asias.hejun@gmail.com
Subject: Re: [PATCH] kvm tools: Support virtio indirect buffers
Date: Tue, 29 Nov 2011 09:45:49 +0200	[thread overview]
Message-ID: <1322552749.3644.3.camel@lappy> (raw)
In-Reply-To: <20111129063105.GR1775@moon>

On Tue, 2011-11-29 at 10:31 +0400, Cyrill Gorcunov wrote:
> On Mon, Nov 28, 2011 at 07:54:27PM +0200, Sasha Levin wrote:
> >  
> > +/*
> > + * Each buffer in the virtqueues is actually a chain of descriptors.  This
> > + * function returns the next descriptor in the chain, or vq->vring.num if we're
> > + * at the end.
> > + */
> > +static unsigned next_desc(struct vring_desc *desc,
> > +			  unsigned int i, unsigned int max)
> > +{
> > +	unsigned int next;
> > +
> > +	/* If this descriptor says it doesn't chain, we're done. */
> > +	if (!(desc[i].flags & VRING_DESC_F_NEXT))
> > +		return max;
> > +
> > +	/* Check they're not leading us off end of descriptors. */
> > +	next = desc[i].next;
> > +	/* Make sure compiler knows to grab that: we don't want it changing! */
> > +	wmb();
> > +
> > +	return next;
> > +}
> > +
> 
> Hi Sasha, where the rmb() then? Or maybe you wanted plain barrier() here?

On the kernel side.
Theres a mb there which happens there during the kick.

-- 

Sasha.


  reply	other threads:[~2011-11-29  7:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-28 17:54 [PATCH] kvm tools: Support virtio indirect buffers Sasha Levin
2011-11-28 18:49 ` Pekka Enberg
2011-11-28 20:17   ` Sasha Levin
2011-11-28 21:05     ` Sasha Levin
2011-11-30  5:20       ` Rusty Russell
2011-11-29  6:31 ` Cyrill Gorcunov
2011-11-29  7:45   ` Sasha Levin [this message]
2011-11-29 13:01     ` Pekka Enberg
2011-11-29 13:06       ` Cyrill Gorcunov

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=1322552749.3644.3.camel@lappy \
    --to=levinsasha928@gmail.com \
    --cc=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.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).