From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [patch uq/master 2/2] kvm-all.c: define smp_wmb and use it for coalesced mmio Date: Mon, 22 Feb 2010 13:57:54 -0300 Message-ID: <20100222165754.GA24872@amt.cnet> References: <20100222135906.347393434@amt.cnet> <20100222140210.130087300@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, "Michael S. Tsirkin" To: kvm@vger.kernel.org, qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:62809 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752020Ab0BVQ6O (ORCPT ); Mon, 22 Feb 2010 11:58:14 -0500 Content-Disposition: inline In-Reply-To: <20100222140210.130087300@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Acked-by: "Michael S. Tsirkin" Signed-off-by: Marcelo Tosatti Index: qemu/kvm-all.c =================================================================== --- qemu.orig/kvm-all.c +++ qemu/kvm-all.c @@ -21,6 +21,7 @@ #include #include "qemu-common.h" +#include "qemu-barrier.h" #include "sysemu.h" #include "hw/hw.h" #include "gdbstub.h" @@ -730,7 +731,7 @@ void kvm_flush_coalesced_mmio_buffer(voi ent = &ring->coalesced_mmio[ring->first]; cpu_physical_memory_write(ent->phys_addr, ent->data, ent->len); - /* FIXME smp_wmb() */ + smp_wmb(); ring->first = (ring->first + 1) % KVM_COALESCED_MMIO_MAX; } } Index: qemu/qemu-barrier.h =================================================================== --- /dev/null +++ qemu/qemu-barrier.h @@ -0,0 +1,7 @@ +#ifndef __QEMU_BARRIER_H +#define __QEMU_BARRIER_H 1 + +/* FIXME: arch dependant, x86 version */ +#define smp_wmb() asm volatile("" ::: "memory") + +#endif From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Njbbu-0005uU-4w for qemu-devel@nongnu.org; Mon, 22 Feb 2010 11:58:18 -0500 Received: from [199.232.76.173] (port=50832 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Njbbt-0005ts-BZ for qemu-devel@nongnu.org; Mon, 22 Feb 2010 11:58:17 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Njbbq-0004NG-8r for qemu-devel@nongnu.org; Mon, 22 Feb 2010 11:58:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1026) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Njbbp-0004N8-Sn for qemu-devel@nongnu.org; Mon, 22 Feb 2010 11:58:14 -0500 Date: Mon, 22 Feb 2010 13:57:54 -0300 From: Marcelo Tosatti Message-ID: <20100222165754.GA24872@amt.cnet> References: <20100222135906.347393434@amt.cnet> <20100222140210.130087300@amt.cnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100222140210.130087300@amt.cnet> Subject: [Qemu-devel] Re: [patch uq/master 2/2] kvm-all.c: define smp_wmb and use it for coalesced mmio List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm@vger.kernel.org, qemu-devel@nongnu.org Cc: avi@redhat.com, "Michael S. Tsirkin" Acked-by: "Michael S. Tsirkin" Signed-off-by: Marcelo Tosatti Index: qemu/kvm-all.c =================================================================== --- qemu.orig/kvm-all.c +++ qemu/kvm-all.c @@ -21,6 +21,7 @@ #include #include "qemu-common.h" +#include "qemu-barrier.h" #include "sysemu.h" #include "hw/hw.h" #include "gdbstub.h" @@ -730,7 +731,7 @@ void kvm_flush_coalesced_mmio_buffer(voi ent = &ring->coalesced_mmio[ring->first]; cpu_physical_memory_write(ent->phys_addr, ent->data, ent->len); - /* FIXME smp_wmb() */ + smp_wmb(); ring->first = (ring->first + 1) % KVM_COALESCED_MMIO_MAX; } } Index: qemu/qemu-barrier.h =================================================================== --- /dev/null +++ qemu/qemu-barrier.h @@ -0,0 +1,7 @@ +#ifndef __QEMU_BARRIER_H +#define __QEMU_BARRIER_H 1 + +/* FIXME: arch dependant, x86 version */ +#define smp_wmb() asm volatile("" ::: "memory") + +#endif