From patchwork Tue Jul 7 16:36:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 6735391 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4C6E2C05AC for ; Tue, 7 Jul 2015 16:37:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 69174205DA for ; Tue, 7 Jul 2015 16:37:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 670BB2053F for ; Tue, 7 Jul 2015 16:37:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757802AbbGGQhH (ORCPT ); Tue, 7 Jul 2015 12:37:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60591 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932198AbbGGQhE (ORCPT ); Tue, 7 Jul 2015 12:37:04 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 8BAC1376B61; Tue, 7 Jul 2015 16:37:04 +0000 (UTC) Received: from thh440s (vpn1-5-58.ams2.redhat.com [10.36.5.58]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t67GavWL009746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 7 Jul 2015 12:37:00 -0400 Date: Tue, 7 Jul 2015 18:36:53 +0200 From: Thomas Huth To: "Michael S. Tsirkin" Cc: Greg Kurz , 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: <20150707183653.462b5df0@thh440s> In-Reply-To: <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> <20150702112809-mutt-send-email-mst@redhat.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, 2 Jul 2015 11:32:52 +0200 "Michael S. Tsirkin" wrote: > 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: ... > > > 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. Would something simple like this already do the job: ? If that looks acceptable, I can submit a proper patch if you like. Thomas --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig --- a/drivers/vhost/Kconfig +++ b/drivers/vhost/Kconfig @@ -35,6 +35,7 @@ config VHOST config VHOST_CROSS_ENDIAN_LEGACY bool "Cross-endian support for vhost" + depends on KVM_BOOK3S_64 || KVM_ARM_HOST default n ---help--- This option allows vhost to support guests with a different byte