From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J10Ml-0003xH-KP for qemu-devel@nongnu.org; Sat, 08 Dec 2007 09:09:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J10Mj-0003x5-8R for qemu-devel@nongnu.org; Sat, 08 Dec 2007 09:09:14 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J10Mj-0003x2-2l for qemu-devel@nongnu.org; Sat, 08 Dec 2007 09:09:13 -0500 Received: from mail2.shareable.org ([80.68.89.115]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J10Mi-0003k3-Ni for qemu-devel@nongnu.org; Sat, 08 Dec 2007 09:09:12 -0500 Date: Sat, 8 Dec 2007 14:09:06 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: [PATCH 2/3] virtio network device Message-ID: <20071208140906.GA22712@shareable.org> References: <4755CC8C.6000001@us.ibm.com> <200712051744.03916.paul@codesourcery.com> <47570817.9090908@us.ibm.com> <200712081322.39762.paul@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200712081322.39762.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Rusty Russell Paul Brook wrote: > > virtio makes things a bit trickier though. There's a shared ring queue > > between the host and guest. The ring queue is lock-less and depends on > > the ability to atomically increment ring queue indices to be SMP safe. > > Using a copy-API wouldn't be a problem for QEMU since the host and guest > > are always running in lock-step. A copy API is actually needed to deal > > with differing host/guest alignment and endianness. > > That seems a rather poor design choice, as many architectures don't have an > atomic increment instruction. Oh well. Most have compare-and-swap or load-locked/store-conditional instructions, though, which can be used to implement atomic increment. -- Jamie