From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8rfs-0002nQ-Pd for qemu-devel@nongnu.org; Mon, 12 Aug 2013 08:56:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8rfm-0005x1-QS for qemu-devel@nongnu.org; Mon, 12 Aug 2013 08:56:40 -0400 Received: from mail-ie0-f179.google.com ([209.85.223.179]:49119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8rfm-0005wt-Kh for qemu-devel@nongnu.org; Mon, 12 Aug 2013 08:56:34 -0400 Received: by mail-ie0-f179.google.com with SMTP id c11so8326067ieb.10 for ; Mon, 12 Aug 2013 05:56:33 -0700 (PDT) From: Anthony Liguori In-Reply-To: <1376299687.32100.159.camel@pasglop> References: <1376294363-4650-1-git-send-email-rusty@rustcorp.com.au> <1376294363-4650-2-git-send-email-rusty@rustcorp.com.au> <1376299687.32100.159.camel@pasglop> Date: Mon, 12 Aug 2013 07:56:28 -0500 Message-ID: <87txivrrsz.fsf@codemonkey.ws> 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: Benjamin Herrenschmidt , Rusty Russell Cc: qemu-devel@nongnu.org Benjamin Herrenschmidt writes: > On Mon, 2013-08-12 at 17:29 +0930, Rusty Russell wrote: >> virtio data structures are defined as "target endian", which assumes >> that's a fixed value. In fact, that actually means it's >> platform-specific. >> >> Hopefully the OASIS virtio 1.0 spec will fix this. Meanwhile, create >> a hook for little endian ppc. > > Ok, sorry if I missed a previous debate on that one but why do you do a > call-out to architecture specific stuff (that is not even inline) on > every access ? Let's focus on getting something merged. Then we can muck around with it down the road. Having target-ppc call into virtio is a layering violation. This approach keeps the dependencies cleaner. Regards, Anthony Liguori > > If we consider that virtio byte order is global, can't you make it a > global that is *set* by the architecture rather than *polled* by > virtio ? > > We have explicit knowledge of when our endianness change (we get the > hcall or a write to some SPR), we can call virtio *then* to adjust the > endianness rather than having a call-out to the platform on every > access. > > Ben.