From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUf38-0007qG-3Y for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:27:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUf31-0003ZS-RO for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:27:02 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44337 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUf31-0003ZE-L2 for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:26:55 -0400 Message-ID: <5339974E.4080200@suse.de> Date: Mon, 31 Mar 2014 18:26:54 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <20140328105709.21018.88000.stgit@bahia.local> <20140328105725.21018.80766.stgit@bahia.local> <533996A8.4040109@suse.de> In-Reply-To: <533996A8.4040109@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, Alexander Graf , qemu-devel@nongnu.org, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, anthony@codemonkey.ws Am 31.03.2014 18:24, schrieb Alexander Graf: > 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 handl= ed >> 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) >=20 > The logical ordering for helper is usually to have the device as the > first parameter (it's basically the self object). Could you please orde= r > it accordingly? Also please note that QEMU Coding Style requests the use of typedefs, i.e. drop the "struct". Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg