From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFkPw-0006iv-32 for qemu-devel@nongnu.org; Tue, 18 Feb 2014 08:09:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFkPo-0004oa-69 for qemu-devel@nongnu.org; Tue, 18 Feb 2014 08:08:56 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:44385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFkPn-0004oO-SH for qemu-devel@nongnu.org; Tue, 18 Feb 2014 08:08:48 -0500 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 18 Feb 2014 13:08:45 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id BD8191B0806B for ; Tue, 18 Feb 2014 13:08:20 +0000 (GMT) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1ID8VHQ5570824 for ; Tue, 18 Feb 2014 13:08:31 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1ID8ear020165 for ; Tue, 18 Feb 2014 06:08:42 -0700 Date: Tue, 18 Feb 2014 14:08:35 +0100 From: Cornelia Huck Message-ID: <20140218140835.1d2d3dce.cornelia.huck@de.ibm.com> In-Reply-To: <20140218123854.9849.25094.stgit@bahia.lab.toulouse-stg.fr.ibm.com> References: <20140218123844.9849.58557.stgit@bahia.lab.toulouse-stg.fr.ibm.com> <20140218123854.9849.25094.stgit@bahia.lab.toulouse-stg.fr.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 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, agraf@suse.de, qemu-devel@nongnu.org, stefanha@redhat.com, anthony@codemonkey.ws, pbonzini@redhat.com, afaerber@suse.de On Tue, 18 Feb 2014 13:38:54 +0100 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. > > [ ldq_phys() API change, Greg Kurz ] > Signed-off-by: Rusty Russell > Signed-off-by: Greg Kurz > --- > hw/virtio/virtio.c | 32 ++++++++++++++++---------------- > 1 file changed, 16 insertions(+), 16 deletions(-) > > static inline void vring_used_flags_unset_bit(VirtQueue *vq, int mask) > { > hwaddr pa; > pa = vq->vring.used + offsetof(VRingUsed, flags); > - stw_phys(&address_space_memory, > - pa, lduw_phys(&address_space_memory, pa) & ~mask); > + virtio_stw_phys(&address_space_memory, > + pa, lduw_phys(&address_space_memory, pa) & ~mask); > } This needs to be virtio_lduw_phys(), no?