Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753642AbbGIM5y (ORCPT ); Thu, 9 Jul 2015 08:57:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57191 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751851AbbGIM5n (ORCPT ); Thu, 9 Jul 2015 08:57:43 -0400 Subject: Re: [PATCH] KVM: Add Kconfig option to signal cross-endian guests To: Laurent Vivier , Thomas Huth , "Michael S. Tsirkin" , kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, kvm-ppc@vger.kernel.org, virtualization@lists.linux-foundation.org, Greg Kurz References: <20150707195012-mutt-send-email-mst@redhat.com> <1436428145-29823-1-git-send-email-thuth@redhat.com> <559E435E.9050608@redhat.com> Cc: linux-arm-kernel@lists.infradead.org, Gleb Natapov , Christoffer Dall , Marc Zyngier , Alexander Graf , Paul Mackerras , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, kraxel@redhat.com, Cornelia Huck , Linus Torvalds From: Paolo Bonzini Message-ID: <559E6FBD.5050502@redhat.com> Date: Thu, 9 Jul 2015 14:57:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <559E435E.9050608@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3636 Lines: 107 On 09/07/2015 11:48, Laurent Vivier wrote: > > > On 09/07/2015 09:49, Thomas Huth wrote: >> The option for supporting cross-endianness legacy guests in >> the vhost and tun code should only be available on systems >> that support cross-endian guests. > > I'm sure I misunderstand something, but what happens if we use QEMU with > TCG instead of KVM, i.e. a big endian powerpc kernel guest on x86_64 > little endian host ? TCG does not yet support irqfd/ioeventfd, so it cannot be used with vhost. Paolo > Do you forbid the use of vhost in this case ? > >> Signed-off-by: Thomas Huth >> --- >> arch/arm/kvm/Kconfig | 1 + >> arch/arm64/kvm/Kconfig | 1 + >> arch/powerpc/kvm/Kconfig | 1 + >> drivers/net/Kconfig | 1 + >> drivers/vhost/Kconfig | 1 + >> virt/kvm/Kconfig | 3 +++ >> 6 files changed, 8 insertions(+) >> >> diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig >> index bfb915d..9d8f363 100644 >> --- a/arch/arm/kvm/Kconfig >> +++ b/arch/arm/kvm/Kconfig >> @@ -31,6 +31,7 @@ config KVM >> select KVM_VFIO >> select HAVE_KVM_EVENTFD >> select HAVE_KVM_IRQFD >> + select KVM_CROSS_ENDIAN_GUESTS >> depends on ARM_VIRT_EXT && ARM_LPAE && ARM_ARCH_TIMER >> ---help--- >> Support hosting virtualized guest machines. >> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig >> index bfffe8f..9af39fe 100644 >> --- a/arch/arm64/kvm/Kconfig >> +++ b/arch/arm64/kvm/Kconfig >> @@ -31,6 +31,7 @@ config KVM >> select KVM_VFIO >> select HAVE_KVM_EVENTFD >> select HAVE_KVM_IRQFD >> + select KVM_CROSS_ENDIAN_GUESTS >> ---help--- >> Support hosting virtualized guest machines. >> >> diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig >> index 3caec2c..e028710 100644 >> --- a/arch/powerpc/kvm/Kconfig >> +++ b/arch/powerpc/kvm/Kconfig >> @@ -79,6 +79,7 @@ config KVM_BOOK3S_64_HV >> select KVM_BOOK3S_HV_POSSIBLE >> select MMU_NOTIFIER >> select CMA >> + select KVM_CROSS_ENDIAN_GUESTS >> ---help--- >> Support running unmodified book3s_64 guest kernels in >> virtual machines on POWER7 and PPC970 processors that have >> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig >> index c18f9e6..0c4ce47 100644 >> --- a/drivers/net/Kconfig >> +++ b/drivers/net/Kconfig >> @@ -261,6 +261,7 @@ config TUN >> config TUN_VNET_CROSS_LE >> bool "Support for cross-endian vnet headers on little-endian kernels" >> default n >> + depends on KVM_CROSS_ENDIAN_GUESTS >> ---help--- >> This option allows TUN/TAP and MACVTAP device drivers in a >> little-endian kernel to parse vnet headers that come from a >> diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig >> index 533eaf0..4d8ae6b 100644 >> --- 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_CROSS_ENDIAN_GUESTS >> default n >> ---help--- >> This option allows vhost to support guests with a different byte >> diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig >> index e2c876d..cc7b28a 100644 >> --- a/virt/kvm/Kconfig >> +++ b/virt/kvm/Kconfig >> @@ -47,3 +47,6 @@ config KVM_GENERIC_DIRTYLOG_READ_PROTECT >> config KVM_COMPAT >> def_bool y >> depends on COMPAT && !S390 >> + >> +config KVM_CROSS_ENDIAN_GUESTS >> + bool >> -- 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/