From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Pekka Enberg <penberg@kernel.org>
Cc: Sasha Levin <levinsasha928@gmail.com>,
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 17:06:10 +0400 [thread overview]
Message-ID: <20111129130610.GA1775@moon> (raw)
In-Reply-To: <alpine.LFD.2.02.1111291501360.9333@tux.localdomain>
On Tue, Nov 29, 2011 at 03:01:59PM +0200, Pekka Enberg wrote:
> >>
> >>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.
>
> I guess we need to improve the comment in next_desc()?
>
Kernel's code has pretty good aliases for virtio barriers I think
#ifdef CONFIG_SMP
/* Where possible, use SMP barriers which are more lightweight than mandatory
* barriers, because mandatory barriers control MMIO effects on accesses
* through relaxed memory I/O windows (which virtio does not use). */
#define virtio_mb() smp_mb()
#define virtio_rmb() smp_rmb()
#define virtio_wmb() smp_wmb()
#else
/* We must force memory ordering even if guest is UP since host could be
* running on another CPU, but SMP barriers are defined to barrier() in that
* configuration. So fall back to mandatory barriers instead. */
#define virtio_mb() mb()
#define virtio_rmb() rmb()
#define virtio_wmb() wmb()
#endif
Maybe we could use somethig similar?
prev parent reply other threads:[~2011-11-29 13:06 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
2011-11-29 13:01 ` Pekka Enberg
2011-11-29 13:06 ` Cyrill Gorcunov [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=20111129130610.GA1775@moon \
--to=gorcunov@gmail.com \
--cc=asias.hejun@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--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 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.