From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUf0S-0006U5-7t for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:24:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUf0L-0002d1-WB for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:24:16 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44270 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUf0L-0002cq-PP for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:24:09 -0400 Message-ID: <533996A8.4040109@suse.de> Date: Mon, 31 Mar 2014 18:24:08 +0200 From: Alexander Graf MIME-Version: 1.0 References: <20140328105709.21018.88000.stgit@bahia.local> <20140328105725.21018.80766.stgit@bahia.local> In-Reply-To: <20140328105725.21018.80766.stgit@bahia.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 2/8] virtio: allow byte swapping for vring and config access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: kwolf@redhat.com, peter.maydell@linaro.org, thuth@linux.vnet.ibm.com, mst@redhat.com, marc.zyngier@arm.com, rusty@rustcorp.com.au, qemu-devel@nongnu.org, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, anthony@codemonkey.ws, afaerber@suse.de On 03/28/2014 11:57 AM, Greg Kurz wrote: > From: Rusty Russell > > This is based on a simpler patch by Anthony Liguouri, which only handled > the vring accesses. We also need some drivers to access these helpers, > eg. for data which contains headers. > > Signed-off-by: Rusty Russell > [ ldq_phys() API change, > use per-device needs_byteswap flag, > Greg Kurz ] > Signed-off-by: Greg Kurz > --- > hw/virtio/virtio.c | 93 ++++++++++++++++++++++++++++++---------------------- > 1 file changed, 53 insertions(+), 40 deletions(-) > > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > index 24b565f..1877b46 100644 > --- a/hw/virtio/virtio.c > +++ b/hw/virtio/virtio.c > @@ -102,53 +102,57 @@ static void virtqueue_init(VirtQueue *vq) > vq->vring.align); > } > > -static inline uint64_t vring_desc_addr(hwaddr desc_pa, int i) > +static inline uint64_t vring_desc_addr(hwaddr desc_pa, int i, > + struct VirtIODevice *vdev) The logical ordering for helper is usually to have the device as the first parameter (it's basically the self object). Could you please order it accordingly? Alex