All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>,
	Paul Brook <paul@codesourcery.com>
Subject: [Qemu-devel] [PATCH-RFC 2/3] virtio: use a real wmb
Date: Tue, 8 Dec 2009 18:18:32 +0200	[thread overview]
Message-ID: <20091208161832.GC32188@redhat.com> (raw)
In-Reply-To: <cover.1260273831.git.mst@redhat.com>

include barriers.h and remove a non-portable
wmb implementation from virtio.c (it will work
for intel but not for other architectures).

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/hw/virtio.c b/hw/virtio.c
index 1f92171..9f020cf 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -15,20 +15,12 @@
 
 #include "virtio.h"
 #include "sysemu.h"
+#include "barriers.h"
 
 /* The alignment to use between consumer and producer parts of vring.
  * x86 pagesize again. */
 #define VIRTIO_PCI_VRING_ALIGN         4096
 
-/* QEMU doesn't strictly need write barriers since everything runs in
- * lock-step.  We'll leave the calls to wmb() in though to make it obvious for
- * KVM or if kqemu gets SMP support.
- * In any case, we must prevent the compiler from reordering the code.
- * TODO: we likely need some rmb()/mb() as well.
- */
-
-#define wmb() __asm__ __volatile__("": : :"memory")
-
 typedef struct VRingDesc
 {
     uint64_t addr;
-- 
1.6.5.2.143.g8cc62

  parent reply	other threads:[~2009-12-08 16:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1260273831.git.mst@redhat.com>
2009-12-08 16:18 ` [Qemu-devel] [PATCH-RFC 1/3] qemu: add barriers.h header Michael S. Tsirkin
2009-12-08 16:18 ` Michael S. Tsirkin [this message]
2009-12-08 16:18 ` [Qemu-devel] [PATCH-RFC 3/3] virtio: add missing barriers Michael S. Tsirkin

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=20091208161832.GC32188@redhat.com \
    --to=mst@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=paul@codesourcery.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 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.