From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGoHE-0000zl-At for qemu-devel@nongnu.org; Fri, 21 Feb 2014 06:28:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGoH5-0000zH-1W for qemu-devel@nongnu.org; Fri, 21 Feb 2014 06:28:20 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:47392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGoH4-0000yv-P3 for qemu-devel@nongnu.org; Fri, 21 Feb 2014 06:28:10 -0500 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Feb 2014 11:28:09 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 74A5A2190068 for ; Fri, 21 Feb 2014 11:28:04 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1LBRtfq55115846 for ; Fri, 21 Feb 2014 11:27:55 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1LBS6C4030065 for ; Fri, 21 Feb 2014 04:28:07 -0700 From: Greg Kurz Date: Fri, 21 Feb 2014 12:28:03 +0100 Message-ID: <20140221112802.15111.10669.stgit@bahia.local> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v5 0/8] virtio endian-ambivalent target fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: afaerber@suse.de Cc: kwolf@redhat.com, peter.maydell@linaro.org, thuth@linux.vnet.ibm.com, mst@redhat.com, marc.zyngier@arm.com, rusty@rustcorp.com.au, agraf@suse.de, qemu-devel@nongnu.org, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, anthony@codemonkey.ws Hi, This serie introduces helpers to enable virtio devices in a cross-endian environment. As of today, we only have legacy virtio but hopefully this helpers will be reused when we implement virtio 1.0. Some assumptions are made for the legacy implementation: - all guest cpus have the same endianness - all virtio devices have the same endianness - endianness does not change while the device is in use The decision to byteswap or not is hence controlled by a global variable that gets initialized on the virtio reset path for each device. This is slightly suboptimal, but since reset is not a critical path, it is a viable solution. Of course, this patchset needs some arch specific enablement to be fully functionnal (PPC patches have already been posted to support KVM and TCG). The changes since the last post are: - fixed SoB lines and subjects, as suggested by Andreas - fixed missing virtio_ in patch 2/8, spotted by Cornelia - relicensed virtio-access.h to GPLv2+ in patch 1/8, as requested by Rusty Thanks for your comments. Best Regards. -- Greg --- Greg Kurz (1): virtio-9p: use virtio wrappers to access headers Rusty Russell (7): virtio_get_byteswap: function for endian-ambivalent targets using virtio virtio: allow byte swapping for vring and config access virtio-net: use virtio wrappers to access headers virtio-balloon: use virtio wrappers to access page frame numbers virtio-blk: use virtio wrappers to access headers virtio-scsi: use virtio wrappers to access headers virtio-serial-bus: use virtio wrappers to access headers hw/9pfs/virtio-9p-device.c | 3 + hw/block/virtio-blk.c | 35 +++++----- hw/char/virtio-serial-bus.c | 34 +++++---- hw/net/virtio-net.c | 15 ++-- hw/scsi/virtio-scsi.c | 33 +++++---- hw/virtio/virtio-balloon.c | 3 + hw/virtio/virtio.c | 38 ++++++---- include/hw/virtio/virtio-access.h | 134 +++++++++++++++++++++++++++++++++++++ include/hw/virtio/virtio.h | 2 + stubs/Makefile.objs | 1 stubs/virtio_get_byteswap.c | 6 ++ 11 files changed, 230 insertions(+), 74 deletions(-) create mode 100644 include/hw/virtio/virtio-access.h create mode 100644 stubs/virtio_get_byteswap.c