Received: from eggs.gnu.org ([2001:4830:134:3::10]:42264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgCTH-0001H8-0X for qemu-devel@nongnu.org; Tue, 12 Nov 2013 06:49:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgCT9-0008VU-1P for qemu-devel@nongnu.org; Tue, 12 Nov 2013 06:49:26 -0500 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:56826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgCT8-0008Sz-OE for qemu-devel@nongnu.org; Tue, 12 Nov 2013 06:49:18 -0500 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 12 Nov 2013 11:49:16 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 92E772190059 for ; Tue, 12 Nov 2013 11:49:13 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rACBlk5B45809682 for ; Tue, 12 Nov 2013 11:47:46 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rACBlvH1006641 for ; Tue, 12 Nov 2013 04:47:58 -0700 Date: Tue, 12 Nov 2013 12:47:55 +0100 From: Thomas Huth Message-ID: <20131112124755.617e9755@oc7435384737.ibm.com> In-Reply-To: <1381982022-19291-1-git-send-email-rusty@rustcorp.com.au> References: <1381982022-19291-1-git-send-email-rusty@rustcorp.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/7] virtio endian-ambivalent target fixes. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rusty Russell Cc: Marc Zyngier , Cornelia Huck , qemu-devel@nongnu.org On Thu, 17 Oct 2013 14:23:35 +1030 Rusty Russell wrote: > This is a re-transmit of the core of the virtio endian code. Since > there seems to be some interest in ARM BE virtio, I've separated this from > the direct problem I was solving: PowerPC LE. > > Please apply! > Rusty. > > Rusty Russell (7): > virtio_get_byteswap: function for endian-ambivalent targets using > virtio. > virtio: allow byte swapping for vring and config access > hw/net/virtio-net: use virtio wrappers to access headers. > hw/net/virtio-balloon: use virtio wrappers to access page frame > numbers. > hw/block/virtio-blk: use virtio wrappers to access headers. > hw/scsi/virtio-scsi: use virtio wrappers to access headers. > hw/char/virtio-serial-bus: use virtio wrappers to access headers. Hi Rusty! May I ask what's the current status of your virtio endian patches? We likely need something similar when we enable Virtio v1.0 for S390 virtio-ccw since we then have to byteswap the virtio stuff there, too. So I recently started to have a look at this... However, in your patches, the byteswapping seems to be activated/disabled globally, with the "virtio_byteswap" variable. But with Virtio v1.0, the guest can decide on a per-device basis whether it wants to drive the device in v1.0 mode (--> byteswap on S390) or in v0.9 legacy mode (--> no byteswap), depending on whether it sets the VIRTIO_F_VERSION_1 feature bit or not. I guess other architectures will have the same problem with Virtio 1.0, too, when the guests are not running in little endian mode. So I wonder whether it would it be feasible to change the code so that the decision of byteswapping or not is done on a per-device basis instead? What do you think? Regards, Thomas