From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NI2oh-0005Ci-CT for qemu-devel@nongnu.org; Tue, 08 Dec 2009 11:21:35 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NI2oc-00056p-NO for qemu-devel@nongnu.org; Tue, 08 Dec 2009 11:21:34 -0500 Received: from [199.232.76.173] (port=38417 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NI2oc-00056T-8u for qemu-devel@nongnu.org; Tue, 08 Dec 2009 11:21:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44256) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NI2ob-0002sa-Qf for qemu-devel@nongnu.org; Tue, 08 Dec 2009 11:21:30 -0500 Date: Tue, 8 Dec 2009 18:18:32 +0200 From: "Michael S. Tsirkin" Message-ID: <20091208161832.GC32188@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] [PATCH-RFC 2/3] virtio: use a real wmb List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Anthony Liguori , Paul Brook 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 --- 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