Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932470AbbD0JOc (ORCPT ); Mon, 27 Apr 2015 05:14:32 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:53553 "EHLO e06smtp14.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752947AbbD0JO3 (ORCPT ); Mon, 27 Apr 2015 05:14:29 -0400 Date: Mon, 27 Apr 2015 11:14:22 +0200 From: Cornelia Huck To: Greg Kurz Cc: Rusty Russell , "Michael S. Tsirkin" , Thomas Huth , kvm@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v6 6/8] virtio: add explicit big-endian support to memory accessors Message-ID: <20150427111422.10564c9e.cornelia.huck@de.ibm.com> In-Reply-To: <20150424122521.19156.65586.stgit@bahia.local> References: <20150424122211.19156.97626.stgit@bahia.local> <20150424122521.19156.65586.stgit@bahia.local> Organization: IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz =?UTF-8?B?R2VzY2jDpGZ0c2bDvGhydW5nOg==?= Dirk Wittkopp Sitz der Gesellschaft: =?UTF-8?B?QsO2Ymxpbmdlbg==?= Registergericht: Amtsgericht Stuttgart, HRB 243294 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15042709-0017-0000-0000-000003DB11CB Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1480 Lines: 41 On Fri, 24 Apr 2015 14:26:24 +0200 Greg Kurz wrote: > The current memory accessors logic is: > - little endian if little_endian > - native endian (i.e. no byteswap) if !little_endian > > If we want to fully support cross-endian vhost, we also need to be > able to convert to big endian. > > Instead of changing the little_endian argument to some 3-value enum, this > patch changes the logic to: > - little endian if little_endian > - big endian if !little_endian > > The native endian case is handled by all users with a trivial helper. This > patch doesn't change any functionality, nor it does add overhead. > > Signed-off-by: Greg Kurz > --- > > Changes since v5: > - changed endian checking helpers as suggested by Thomas (use || and line > breaker) > > drivers/net/macvtap.c | 3 ++- > drivers/net/tun.c | 3 ++- > drivers/vhost/vhost.h | 3 ++- > include/linux/virtio_byteorder.h | 24 ++++++++++++++---------- > include/linux/virtio_config.h | 3 ++- > include/linux/vringh.h | 3 ++- > 6 files changed, 24 insertions(+), 15 deletions(-) > Reviewed-by: Cornelia Huck -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/