From: "Michael S. Tsirkin" <mst@redhat.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: sjur@brendeland.net, Linus Walleij <linus.walleij@linaro.org>,
Erwan Yvin <erwan.yvin@stericsson.com>,
virtualization@lists.linux-foundation.org,
sjur.brandeland@stericsson.com
Subject: Re: [PATCH 2/2] tools/virtio: make barriers stronger.
Date: Wed, 6 Mar 2013 12:20:17 +0200 [thread overview]
Message-ID: <20130306102017.GB16921@redhat.com> (raw)
In-Reply-To: <87vc95b019.fsf@rustcorp.com.au>
On Wed, Mar 06, 2013 at 03:54:42PM +1100, Rusty Russell wrote:
> In the coming vringh_test, we share an mmap with another userspace process
> for testing. This requires real barriers.
>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
>
> diff --git a/tools/virtio/asm/barrier.h b/tools/virtio/asm/barrier.h
> index aff61e1..7a63693 100644
> --- a/tools/virtio/asm/barrier.h
> +++ b/tools/virtio/asm/barrier.h
> @@ -3,8 +3,8 @@
> #define mb() __sync_synchronize()
>
> #define smp_mb() mb()
> -# define smp_rmb() barrier()
> -# define smp_wmb() barrier()
> +# define smp_rmb() mb()
> +# define smp_wmb() mb()
> /* Weak barriers should be used. If not - it's a bug */
> # define rmb() abort()
> # define wmb() abort()
Hmm this seems wrong on x86 which has strong order in hardware.
It should not matter whether the other side is a userspace
process or a kernel thread.
--
MST
next prev parent reply other threads:[~2013-03-06 10:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-05 13:51 [PATCH vringh] virtio: Introduce vringh wrappers in virtio_config sjur.brandeland
2013-03-06 4:42 ` Rusty Russell
2013-03-06 10:50 ` Sjur Brændeland
2013-03-06 12:16 ` Ohad Ben-Cohen
2013-03-06 12:37 ` Sjur Brændeland
2013-03-06 23:28 ` Sjur Brændeland
2013-03-06 4:46 ` [FYI] vringh fixes Rusty Russell
2013-03-06 4:53 ` [PATCH 1/2] Rusty Russell
2013-03-06 4:54 ` [PATCH 2/2] tools/virtio: make barriers stronger Rusty Russell
2013-03-06 10:20 ` Michael S. Tsirkin [this message]
2013-03-07 3:48 ` Rusty Russell
2013-03-07 9:29 ` Michael S. Tsirkin
2013-03-07 23:56 ` Rusty Russell
2013-03-06 4:57 ` [PATCH 1/3] vringh: host-side implementation of virtio rings (v2) Rusty Russell
2013-03-06 4:59 ` [PATCH 2/3] vringh: don't flag already listening Rusty Russell
2013-03-06 5:02 ` [PATCH 3/3] tools/virtio: add vring_test (v2) Rusty Russell
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=20130306102017.GB16921@redhat.com \
--to=mst@redhat.com \
--cc=erwan.yvin@stericsson.com \
--cc=linus.walleij@linaro.org \
--cc=rusty@rustcorp.com.au \
--cc=sjur.brandeland@stericsson.com \
--cc=sjur@brendeland.net \
--cc=virtualization@lists.linux-foundation.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).