From patchwork Mon Feb 22 13:59:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 45963 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 86D1DB6EFF for ; Tue, 23 Feb 2010 01:14:02 +1100 (EST) Received: from localhost ([127.0.0.1]:52562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjZ0y-0002K7-JW for incoming@patchwork.ozlabs.org; Mon, 22 Feb 2010 09:12:00 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NjYsY-0007sm-H1 for qemu-devel@nongnu.org; Mon, 22 Feb 2010 09:03:18 -0500 Received: from [199.232.76.173] (port=42610 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjYsX-0007sM-Ss for qemu-devel@nongnu.org; Mon, 22 Feb 2010 09:03:17 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NjYsU-0002LG-GM for qemu-devel@nongnu.org; Mon, 22 Feb 2010 09:03:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6445) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NjYsU-0002Kw-39 for qemu-devel@nongnu.org; Mon, 22 Feb 2010 09:03: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 o1ME3CoV013032 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 22 Feb 2010 09:03:12 -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 o1ME3BGB014811; Mon, 22 Feb 2010 09:03:11 -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 o1ME39X7004564; Mon, 22 Feb 2010 09:03:10 -0500 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 01FCB652014; Mon, 22 Feb 2010 11:02:57 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o1ME2tFA021007; Mon, 22 Feb 2010 11:02:55 -0300 Message-Id: <20100222140210.130087300@amt.cnet> User-Agent: quilt/0.47-1 Date: Mon, 22 Feb 2010 10:59:08 -0300 From: Marcelo Tosatti To: kvm@vger.kernel.org, qemu-devel@nongnu.org References: <20100222135906.347393434@amt.cnet> Content-Disposition: inline; filename=smp-wmb-kvm-all X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Marcelo Tosatti , avi@redhat.com, "Michael S. Tsirkin" Subject: [Qemu-devel] [patch uq/master 2/2] kvm-all.c: define smp_wmb and use it for coalesced mmio X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Cc: "Michael S. Tsirkin" Signed-off-by: Marcelo Tosatti Acked-by: Michael S. Tsirkin 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; } }