Commit 5985eceeaa45d35c4a447c164627a1aa5e23319a

Authored by aliguori
1 parent 5c6602c5

Allow KVM to be used on either 32-bit or 64-bit x86

Inspired by a patch from Glauber Costa.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5631 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 5 additions and 3 deletions
configure
... ... @@ -1447,8 +1447,10 @@ interp_prefix1=`echo &quot;$interp_prefix&quot; | sed &quot;s/%M/$target_cpu/g&quot;`
1447 1447 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1448 1448 gdb_xml_files=""
1449 1449  
1450   -# FIXME allow i386 to build on x86_64 and vice versa
1451   -if test "$kvm" = "yes" -a "$target_cpu" != "$cpu" ; then
  1450 +# Make sure the target and host cpus are compatible
  1451 +if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
  1452 + \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \
  1453 + \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then
1452 1454 kvm="no"
1453 1455 fi
1454 1456 # Disable KVM for linux-user
... ... @@ -1468,7 +1470,7 @@ case &quot;$target_cpu&quot; in
1468 1470 if test "$kvm" = "yes" ; then
1469 1471 echo "CONFIG_KVM=yes" >> $config_mak
1470 1472 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1471   - echo "#define CONFIG_KVM" >> $config_h
  1473 + echo "#define CONFIG_KVM 1" >> $config_h
1472 1474 fi
1473 1475 gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
1474 1476 if test -n "$gcc3minver" && test $gcc3minver -gt 3
... ...