From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUxPe-0001tD-6r for qemu-devel@nongnu.org; Tue, 01 Apr 2014 08:03:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUxPW-0003E3-NM for qemu-devel@nongnu.org; Tue, 01 Apr 2014 08:03:30 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:44165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUxPW-0003Dc-Ez for qemu-devel@nongnu.org; Tue, 01 Apr 2014 08:03:22 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Apr 2014 13:03:21 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id B67C417D8059 for ; Tue, 1 Apr 2014 13:04:06 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s31C35Od4325848 for ; Tue, 1 Apr 2014 12:03:06 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s31C3FVZ004322 for ; Tue, 1 Apr 2014 06:03:16 -0600 Date: Tue, 1 Apr 2014 14:03:13 +0200 From: Greg Kurz Message-ID: <20140401140313.4afba47b@bahia.local> In-Reply-To: <5339974E.4080200@suse.de> References: <20140328105709.21018.88000.stgit@bahia.local> <20140328105725.21018.80766.stgit@bahia.local> <533996A8.4040109@suse.de> <5339974E.4080200@suse.de> MIME-Version: 1.0 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: Andreas =?UTF-8?B?RsOkcmJlcg==?= 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 On Mon, 31 Mar 2014 18:26:54 +0200 Andreas F=C3=A4rber wrote: > 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 order > > it accordingly? >=20 > Also please note that QEMU Coding Style requests the use of typedefs, > i.e. drop the "struct". >=20 > Regards, > Andreas >=20 >=20 Oops my bad... I did not know about the HACKING file until your mail. :) I will fixe that. Thanks. --=20 Gregory Kurz kurzgreg@fr.ibm.com gkurz@linux.vnet.ibm.com Software Engineer @ IBM/Meiosys http://www.ibm.com Tel +33 (0)562 165 496 "Anarchy is about taking complete responsibility for yourself." Alan Moore.