From patchwork Mon Feb 22 16:57:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 81186 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1MGwGoM016664 for ; Mon, 22 Feb 2010 16:58:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752297Ab0BVQ6P (ORCPT ); Mon, 22 Feb 2010 11:58:15 -0500 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 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1MGwCbD021085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 22 Feb 2010 11:58:13 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1MGwC5K004829; Mon, 22 Feb 2010 11:58:12 -0500 Received: from amt.cnet (vpn-11-163.rdu.redhat.com [10.11.11.163]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o1MGwAM3021923; Mon, 22 Feb 2010 11:58:11 -0500 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id C223D68A230; Mon, 22 Feb 2010 13:57:56 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o1MGvsps024912; Mon, 22 Feb 2010 13:57:54 -0300 Date: Mon, 22 Feb 2010 13:57:54 -0300 From: Marcelo Tosatti To: kvm@vger.kernel.org, qemu-devel@nongnu.org Cc: avi@redhat.com, "Michael S. Tsirkin" Subject: Re: [patch uq/master 2/2] kvm-all.c: define smp_wmb and use it for coalesced mmio Message-ID: <20100222165754.GA24872@amt.cnet> References: <20100222135906.347393434@amt.cnet> <20100222140210.130087300@amt.cnet> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100222140210.130087300@amt.cnet> User-Agent: Mutt/1.5.20 (2009-08-17) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 22 Feb 2010 16:58:16 +0000 (UTC) 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