From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzswK-00080q-Ho for qemu-devel@nongnu.org; Sat, 03 Sep 2011 12:19:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzswJ-000405-L6 for qemu-devel@nongnu.org; Sat, 03 Sep 2011 12:19:28 -0400 Received: from mail-fx0-f45.google.com ([209.85.161.45]:54636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzswJ-0003zu-B5 for qemu-devel@nongnu.org; Sat, 03 Sep 2011 12:19:27 -0400 Received: by fxbb27 with SMTP id b27so2691162fxb.4 for ; Sat, 03 Sep 2011 09:19:26 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4E62538B.7030409@redhat.com> Date: Sat, 03 Sep 2011 18:19:23 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20110901163359.GB11620@redhat.com> <786649703.1049386.1314909069542.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> <20110902154549.GA18368@redhat.com> In-Reply-To: <20110902154549.GA18368@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio: Make memory barriers be memory barriers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: aliguori@us.ibm.com, aik@ozlabs.ru, rusty@rustcorp.com.au, agraf@suse.de, qemu-devel@nongnu.org, David Gibson On 09/02/2011 05:45 PM, Michael S. Tsirkin wrote: > Well, can you describe an issue in virtio that lfence/sfence help solve > in terms of a memory model please? > Pls note that guest uses smp_ variants for barriers. /* Make sure buffer is written before we update index. */ wmb(); Without it, a guest could see a partially updated buffer, because the buffer and index writes are unlocked stores to different locations. Even if the guest uses barriers, with ioeventfd it will only order the CPU that is running the guest, not the one that is running the iothread. In fact I'm surprised that it works at all under x86 with ioeventfd. Paolo