From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J4SFf-0004hr-N2 for qemu-devel@nongnu.org; Mon, 17 Dec 2007 21:32:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J4SFc-0004g1-RX for qemu-devel@nongnu.org; Mon, 17 Dec 2007 21:32:11 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J4SFc-0004fs-M5 for qemu-devel@nongnu.org; Mon, 17 Dec 2007 21:32:08 -0500 Received: from ozlabs.org ([203.10.76.45]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J4SFc-0007fk-H4 for qemu-devel@nongnu.org; Mon, 17 Dec 2007 21:32:08 -0500 From: Rusty Russell Subject: Re: [Qemu-devel] Re: [PATCH 2/3] virtio network device Date: Tue, 18 Dec 2007 13:31:51 +1100 References: <4755CC8C.6000001@us.ibm.com> <200712121224.38403.rusty@rustcorp.com.au> <475F3C1B.707@codemonkey.ws> In-Reply-To: <475F3C1B.707@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200712181331.52341.rusty@rustcorp.com.au> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Anthony Liguori , qemu-devel@nongnu.org, Paul Brook On Wednesday 12 December 2007 12:40:43 Anthony Liguori wrote: > Rusty Russell wrote: > > On Sunday 09 December 2007 09:02:48 Anthony Liguori wrote: > >> If QEMU ever got true SMP support, then virtio would not work as it > >> requires 16-bit atomic writes which AFAIK is not possible on a number of > >> non-x86 architectures. > > > > Hmm? Where is this requirement coming from? > > > > I think everyone should stop using the word "atomic" in virtio > > discussions; it's confusing. > > The virtio ring queue indices are 16-bit and are readable to one end > while writable on the other end. To ensure that this can be done in a > lock-less way, it's necessary to atomically update the index. Atomic is > the right word here because if the 16-bit write gets converted into two > 8-bit writes, then very bad things could happen with SMP. Of course, but that's insane. Your assertion that it's not possible on a number of non-x86 architectures is what I'm questioning here. You're confusing the inability of architectures to atomically *modify* a 16 bit value and our requirement, where even if you found an architecture which couldn't do 16 bit writes, you can do it as a 32 bit write. Hope that clarifies, Rusty.