From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NjZZe-0002e6-HP for qemu-devel@nongnu.org; Mon, 22 Feb 2010 09:47:50 -0500 Received: from [199.232.76.173] (port=56629 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjZZe-0002dd-0k for qemu-devel@nongnu.org; Mon, 22 Feb 2010 09:47:50 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NjZZc-0005Jg-OV for qemu-devel@nongnu.org; Mon, 22 Feb 2010 09:47:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30484) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NjZZc-0005Jc-Cw for qemu-devel@nongnu.org; Mon, 22 Feb 2010 09:47:48 -0500 Date: Mon, 22 Feb 2010 16:44:32 +0200 From: "Michael S. Tsirkin" Message-ID: <20100222144432.GA20580@redhat.com> 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: Marcelo Tosatti Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, avi@redhat.com On Mon, Feb 22, 2010 at 10:59:08AM -0300, Marcelo Tosatti wrote: > Cc: "Michael S. Tsirkin" > Signed-off-by: Marcelo Tosatti Acked-by: Michael S. Tsirkin We'll need implementation for other arches, I'll dust off my patch that adds it and repost, but for now this is better than what we have. > Index: qemu/kvm-all.c > =================================================================== > --- qemu.orig/kvm-all.c > +++ qemu/kvm-all.c > @@ -718,6 +718,9 @@ static int kvm_handle_io(uint16_t port, > return 1; > } > > +/* FIXME: arch dependant, x86 version */ > +#define smp_wmb() asm volatile("" ::: "memory") > + > void kvm_flush_coalesced_mmio_buffer(void) > { > #ifdef KVM_CAP_COALESCED_MMIO > @@ -730,7 +733,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; > } > } >