From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGftN-0002lN-1O for qemu-devel@nongnu.org; Thu, 20 Feb 2014 21:31:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGftI-0000rW-5P for qemu-devel@nongnu.org; Thu, 20 Feb 2014 21:31:08 -0500 Received: from ozlabs.org ([203.10.76.45]:43259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGftH-0000rP-RB for qemu-devel@nongnu.org; Thu, 20 Feb 2014 21:31:04 -0500 From: Rusty Russell In-Reply-To: <53038876.50301@suse.de> References: <20140218123844.9849.58557.stgit@bahia.lab.toulouse-stg.fr.ibm.com> <20140218123849.9849.77875.stgit@bahia.lab.toulouse-stg.fr.ibm.com> <530372C6.70503@suse.de> <20140218150327.GA9457@redhat.com> <20140218161208.2b174e13.cornelia.huck@de.ibm.com> <20140218164501.7acd2f84.cornelia.huck@de.ibm.com> <20140218171700.5899a8c7.cornelia.huck@de.ibm.com> <53038876.50301@suse.de> Date: Fri, 21 Feb 2014 09:56:46 +1030 Message-ID: <87bny19xhl.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 1/8] virtio_get_byteswap: function for endian-ambivalent targets using virtio. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , Cornelia Huck Cc: "kwolf@redhat.com" , "peter.maydell@linaro.org" , "thuth@linux.vnet.ibm.com" , "Michael S. Tsirkin" , "marc.zyngier@arm.com" , "qemu-devel@nongnu.org" , "stefanha@redhat.com" , "anthony@codemonkey.ws" , "pbonzini@redhat.com" , "afaerber@suse.de" , Greg Kurz Alexander Graf writes: > On 02/18/2014 05:17 PM, Cornelia Huck wrote: >> Hm. So whatever_le for 1.0 devices, and virtio_whatever (checking the >> byteswap value) for legacy devices? The device implementation will be >> aware of the virtio version anyway. > > Yeah, but I would hope we want to share as much code as possible here, > so that config accessors can be shared between legacy virtio and 1.0 > virtio. And in that case we want to have a generic helper to read/write > pieces of that config space - which this patch introduces for us :). > >> (Btw., can some of those architectures supporting both le/be run with >> mixed le/be cpus? That would be a mess for legacy devices.) > > Yes, they can. No, we don't care :). There's per-cpu (what endian) and per-device (legacy or no). To do this Right, we'd need to consult both, but we don't always have that information. So this the minimal viable solution. We'll need a per-device legacy flag eventually (there are other changes than just endian). But getting the wrappers in place is a good first step. Cheers, Rusty.