Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932578AbbD0JRi (ORCPT ); Mon, 27 Apr 2015 05:17:38 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:40113 "EHLO e06smtp10.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932395AbbD0JRg (ORCPT ); Mon, 27 Apr 2015 05:17:36 -0400 Date: Mon, 27 Apr 2015 11:17:29 +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 7/8] vhost: cross-endian support for legacy devices Message-ID: <20150427111729.06a9492e.cornelia.huck@de.ibm.com> In-Reply-To: <20150424122632.19156.88058.stgit@bahia.local> References: <20150424122211.19156.97626.stgit@bahia.local> <20150424122632.19156.88058.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-0041-0000-0000-0000040F1A86 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1692 Lines: 40 On Fri, 24 Apr 2015 14:27:24 +0200 Greg Kurz wrote: > This patch brings cross-endian support to vhost when used to implement > legacy virtio devices. Since it is a relatively rare situation, the > feature availability is controlled by a kernel config option (not set > by default). > > The vq->is_le boolean field is added to cache the endianness to be > used for ring accesses. It defaults to native endian, as expected > by legacy virtio devices. When the ring gets active, we force little > endian if the device is modern. When the ring is deactivated, we > revert to the native endian default. > > If cross-endian was compiled in, a vq->user_be boolean field is added > so that userspace may request a specific endianness. This field is > used to override the default when activating the ring of a legacy > device. It has no effect on modern devices. > > Signed-off-by: Greg Kurz > --- > > Changes since v5: > - fixed description in Kconfig > - fixed error description in uapi header > - dropped useless semi-colon in the vhost_vq_reset_user_be() stub > > drivers/vhost/Kconfig | 15 ++++++++ > drivers/vhost/vhost.c | 85 +++++++++++++++++++++++++++++++++++++++++++- > drivers/vhost/vhost.h | 11 +++++- > include/uapi/linux/vhost.h | 14 +++++++ > 4 files changed, 122 insertions(+), 3 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/