From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7Skw-00078J-P8 for qemu-devel@nongnu.org; Thu, 08 Aug 2013 12:08:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7Skq-0007Qc-HA for qemu-devel@nongnu.org; Thu, 08 Aug 2013 12:08:06 -0400 Received: from mail-ie0-f178.google.com ([209.85.223.178]:54659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7Skq-0007QK-Ca for qemu-devel@nongnu.org; Thu, 08 Aug 2013 12:08:00 -0400 Received: by mail-ie0-f178.google.com with SMTP id f4so2109136iea.23 for ; Thu, 08 Aug 2013 09:08:00 -0700 (PDT) From: Anthony Liguori In-Reply-To: <20130808154507.GX14664@redhat.com> References: <1375938949-22622-1-git-send-email-rusty@rustcorp.com.au> <1375938949-22622-2-git-send-email-rusty@rustcorp.com.au> <87li4cgvh1.fsf@codemonkey.ws> <5203AB19.9070505@suse.de> <87r4e4p4wj.fsf@codemonkey.ws> <20130808154507.GX14664@redhat.com> Date: Thu, 08 Aug 2013 11:07:56 -0500 Message-ID: <87pptof9nn.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/7] virtio: allow byte swapping for vring and config access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Peter Maydell , Rusty Russell , Andreas =?utf-8?Q?F=C3=A4rber?= , qemu-devel@nongnu.org "Daniel P. Berrange" writes: > On Thu, Aug 08, 2013 at 10:40:28AM -0500, Anthony Liguori wrote: >> Andreas F=C3=A4rber writes: >> >> We have a mechanism to do weak functions via stubs/. I think it would >> >> be better to do cpu_get_byteswap() as a stub function and then overlo= ad >> >> it in the ppc64 code. >> > >> > If this as your name indicates is a per-CPU function then it should go >> > into CPUClass. Interesting question is, what is virtio supposed to do = if >> > we have two ppc CPUs, one is Big Endian, the other is Little Endian. >>=20 >> PPC64 is big endian. AFAIK, there is no such thing as a little endian >> PPC64 processor. > > Unless I'm misunderstanding, this thread seems to suggest otherwise: > > "[Qemu-devel] [PATCH 0/5] 64bit PowerPC little endian support" > > https://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00813.html Yeah, it's confusing. It feels like little endian to most software but the distinction in hardware (and therefore QEMU) is important. It's the same processor. It still starts executing big endian instructions. A magic register value is tweaked and loads/stores are swapped. CPU data structures are still read as big endian though. It's really just load/stores that are affected. The distinction is important in QEMU. ppc64 is still TARGET_WORDS_BIGENDIAN. We still want most stl_phys to treat integers as big endian. There's just this extra concept that CPU loads/stores are sometimes byte swapped. That affects virtio but not a lot else. Regards, Anthony Liguori > > > Daniel > --=20 > |: http://berrange.com -o- http://www.flickr.com/photos/dberrange= / :| > |: http://libvirt.org -o- http://virt-manager.or= g :| > |: http://autobuild.org -o- http://search.cpan.org/~danberr= / :| > |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vn= c :|