Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752772AbbGBJdG (ORCPT ); Thu, 2 Jul 2015 05:33:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39536 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751683AbbGBJc5 (ORCPT ); Thu, 2 Jul 2015 05:32:57 -0400 Date: Thu, 2 Jul 2015 11:32:52 +0200 From: "Michael S. Tsirkin" To: Greg Kurz Cc: Linus Torvalds , KVM list , virtualization , Network Development , Linux Kernel Mailing List , Cornelia Huck , kraxel@redhat.com Subject: Re: [PULL] virtio/vhost: cross endian support Message-ID: <20150702112809-mutt-send-email-mst@redhat.com> References: <20150701113150-mutt-send-email-mst@redhat.com> <20150702071412-mutt-send-email-mst@redhat.com> <20150702111256.13f8ea71@bahia.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150702111256.13f8ea71@bahia.local> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2301 Lines: 58 On Thu, Jul 02, 2015 at 11:12:56AM +0200, Greg Kurz wrote: > On Thu, 2 Jul 2015 08:01:28 +0200 > "Michael S. Tsirkin" wrote: > > > On Wed, Jul 01, 2015 at 12:02:50PM -0700, Linus Torvalds wrote: > > > On Wed, Jul 1, 2015 at 2:31 AM, Michael S. Tsirkin wrote: > > > > virtio/vhost: cross endian support > > > > > > Ugh. Does this really have to be dynamic? > > > > > > Can't virtio do the sane thing, and just use a _fixed_ endianness? > > > > > > Doing a unconditional byte swap is faster and simpler than the crazy > > > conditionals. That's true regardless of endianness, but gets to be > > > even more so if the fixed endianness is little-endian, since BE is > > > not-so-slowly fading from the world. > > > > > > Linus > > > > Yea, well - support for legacy BE guests on the new LE hosts is > > exactly the motivation for this. > > > > I dislike it too, but there are two redeeming properties that > > made me merge this: > > > > 1. It's a trivial amount of code: since we wrap host/guest accesses > > anyway, almost all of it is well hidden from drivers. > > > > 2. Sane platforms would never set flags like VHOST_CROSS_ENDIAN_LEGACY - > > and when it's clear, there's zero overhead (as some point it was > > tested by compiling with and without the patches, got the same > > stripped binary). > > > > Maybe we could create a Kconfig symbol to enforce point (2): prevent > > people from enabling it e.g. on x86. I will look into this - but it can > > be done by a patch on top, so I think this can be merged as is. > > > > This cross-endian *oddity* is targeting PowerPC book3s_64 processors... I > am not aware of any other users. Maybe create a symbol that would > be only selected by PPC_BOOK3S_64 ? I think some ARM systems are trying to support cross-endian configurations as well. Besides that, yes, this is more or less what I had in mind. > > > Or do you know of someone using kernel with all config options enabled > > undiscriminately? > > > > Thanks, > > -- 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/