From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qxu8F-0001yB-DP for qemu-devel@nongnu.org; Mon, 29 Aug 2011 01:11:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qxu8C-00085V-Mp for qemu-devel@nongnu.org; Mon, 29 Aug 2011 01:11:35 -0400 Received: from ozlabs.org ([203.10.76.45]:60202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qxu8C-00085L-De for qemu-devel@nongnu.org; Mon, 29 Aug 2011 01:11:32 -0400 From: Rusty Russell In-Reply-To: <20110826054008.GL2308@yookeroo.fritz.box> References: <20110826054008.GL2308@yookeroo.fritz.box> Date: Mon, 29 Aug 2011 12:13:47 +0930 Message-ID: <87ipph2azg.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] Missing barriers in hw/virtio.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , qemu-devel@nongnu.org Cc: aik@ozlabs.ru, agraf@suse.de, Benjamin Herrenschmidt On Fri, 26 Aug 2011 15:40:08 +1000, David Gibson wrote: > Near the top of hw/virtio.c we have this: > > /* QEMU doesn't strictly need write barriers since everything runs in > * lock-step. We'll leave the calls to wmb() in though to make it > obvious for > * KVM or if kqemu gets SMP support. > * In any case, we must prevent the compiler from reordering the code. > * TODO: we likely need some rmb()/mb() as well. > */ > > #define wmb() __asm__ __volatile__("": : :"memory") > > > However, as far as I can tell when using both kvm and io-thread, the > assertion that barriers aren't necessary just isn't true. Although it > probably works on x86 with its strongly ordered model. That looks very much like it's cribbed from the original lguest code. Very wrong, please fix! Thanks, Rusty.