From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MDNFk-0004bq-3N for qemu-devel@nongnu.org; Sun, 07 Jun 2009 14:37:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MDNFe-0004PZ-Ua for qemu-devel@nongnu.org; Sun, 07 Jun 2009 14:37:55 -0400 Received: from [199.232.76.173] (port=57101 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDNFe-0004PH-Qs for qemu-devel@nongnu.org; Sun, 07 Jun 2009 14:37:50 -0400 Received: from mail-qy0-f191.google.com ([209.85.221.191]:61367) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MDNFe-0005hp-Es for qemu-devel@nongnu.org; Sun, 07 Jun 2009 14:37:50 -0400 Received: by qyk29 with SMTP id 29so3415525qyk.4 for ; Sun, 07 Jun 2009 11:37:48 -0700 (PDT) Message-ID: <4A2C08FA.6070407@codemonkey.ws> Date: Sun, 07 Jun 2009 13:37:46 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: POLL: Why do you use kqemu? References: <4A2A92FE.2010700@redhat.com> <4A2B7F5E.8050807@web.de> <4A2B8787.5080603@web.de> <20090607112325.GD29048@redhat.com> <4A2BA708.4070004@redhat.com> <4A2BB5FE.3000301@redhat.com> <4A2BC220.6090908@redhat.com> In-Reply-To: <4A2BC220.6090908@redhat.com> Content-Type: multipart/mixed; boundary="------------020507060909070709000904" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Blue Swirl , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Jan Kiszka , "qemu-devel@nongnu.org" , Gleb Natapov This is a multi-part message in MIME format. --------------020507060909070709000904 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Avi Kivity wrote: > Blue Swirl wrote: >> I found a bug in configure, if there are targets that can't use KVM, >> it is disabled for all targets. >> > > Yes. kvm support should be an array, not a scalar. Note we shouldn't > even attempt kvm if the host and target don't match. It doesn't need to be an array. Something like this should work. Regards, Anthony Liguori --------------020507060909070709000904 Content-Type: text/x-patch; name="kvm-configure.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kvm-configure.patch" commit 75081cfc8a0cba8fe1760f8fc861c3dc3fba6fd1 Author: Anthony Liguori Date: Sun Jun 7 13:35:41 2009 -0500 Don't globally disable kvm if one target doesn't support it When iterating through each element in target_list, we disable kvm if we find a target that doesn't support kvm. This means that kvm can get globally disabled when configuring with multiple targets. Instead, use a new variable, has_kvm, to indicate whether the target has kvm support or not. Signed-off-by: Anthony Liguori diff --git a/configure b/configure index 6ab4d80..f89327c 100755 --- a/configure +++ b/configure @@ -1828,16 +1828,18 @@ interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"` echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h gdb_xml_files="" +has_kvm="$kvm" + # Make sure the target and host cpus are compatible if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \ \( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \ \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \ \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then - kvm="no" + has_kvm="no" fi # Disable KVM for linux-user if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then - kvm="no" + has_kvm="no" fi case "$target_cpu" in @@ -1850,7 +1852,7 @@ case "$target_cpu" in echo "CONFIG_KQEMU=yes" >> $config_mak echo "#define CONFIG_KQEMU 1" >> $config_h fi - if test "$kvm" = "yes" ; then + if test "$has_kvm" = "yes" ; then echo "CONFIG_KVM=yes" >> $config_mak echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak echo "#define CONFIG_KVM 1" >> $config_h @@ -1872,7 +1874,7 @@ case "$target_cpu" in echo "CONFIG_KQEMU=yes" >> $config_mak echo "#define CONFIG_KQEMU 1" >> $config_h fi - if test "$kvm" = "yes" ; then + if test "$has_kvm" = "yes" ; then echo "CONFIG_KVM=yes" >> $config_mak echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak echo "#define CONFIG_KVM 1" >> $config_h @@ -1949,7 +1951,7 @@ case "$target_cpu" in echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h echo "#define TARGET_PPC 1" >> $config_h echo "#define TARGET_PPCEMB 1" >> $config_h - if test "$kvm" = "yes" ; then + if test "$has_kvm" = "yes" ; then echo "CONFIG_KVM=yes" >> $config_mak echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak echo "#define CONFIG_KVM 1" >> $config_h --------------020507060909070709000904--