aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.target
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-05-20 01:18:01 +0200
committerDavid 'Digit' Turner <digit@android.com>2011-05-26 01:41:57 +0200
commit36597756e589622ee6c6628efb47c1b130d5ee85 (patch)
treef62f0a9d22a15afa3166912a9eb6a371d67d3845 /Makefile.target
parent21ca493a04b74f35d3fd263afb369f7a1eda7aae (diff)
downloadexternal_qemu-36597756e589622ee6c6628efb47c1b130d5ee85.zip
external_qemu-36597756e589622ee6c6628efb47c1b130d5ee85.tar.gz
external_qemu-36597756e589622ee6c6628efb47c1b130d5ee85.tar.bz2
x86: kvm: fix KVM build + enable auto-detection.
This patch fixes the build of KVM support in the x86 emulator by copying official Ubuntu Lucid KVM headers into android/config/linux-*/ This removes the need to rely on the build machine's versions of these headers, which caused various issues. Also, by default, the emulator will now probe the system to see if it can start in KVM mode automatically. See android-kvm.c for details. You can see the result of the probing with the -verbose option. IMPORTANT NOTE: It looks like there is a bug in the KVM code when the emulator is built as a 32-bit binary, running on a 64-bit kernel, so we explicitely disable KVM when we detect this case. It's hard to tell whether this is a bug in QEMU or some versions of the KVM driver. As such, KVM only works when building the emulator as a 64-bit program. For now, this is only possible with "android-configure.sh --try-64", not the Android build system. + Add a new QEMU option (-disable-kvm) to explicitely disable KVM if needed. This is an addition to -enable-kvm which already exists (and forces usage of KVM). Change-Id: I6a397cae29ab62b1c56fce95c1ee75a4664d6688
Diffstat (limited to 'Makefile.target')
-rw-r--r--Makefile.target13
1 files changed, 7 insertions, 6 deletions
diff --git a/Makefile.target b/Makefile.target
index 7681dba..6a6f753 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -175,12 +175,13 @@ LOCAL_SRC_FILES += fpu/softfloat-native.c
endif
# compile KVM only if target is x86 on x86 Linux
-ifeq ($(QEMU_HOST_TAG)-$(EMULATOR_TARGET_ARCH),linux-x86-x86)
-# the following is to include linux/kvm.h
-LOCAL_CFLAGS += -I /usr/include
-LOCAL_SRC_FILES += \
- target-i386/kvm.c \
- kvm-all.c
+QEMU_KVM_TAG := $(QEMU_HOST_TAG)-$(EMULATOR_TARGET_ARCH)
+QEMU_DO_KVM := $(if $(filter linux-x86-x86 linux-x86_64-x86,$(QEMU_KVM_TAG)),true,false)
+ifeq ($(QEMU_DO_KVM),true)
+ LOCAL_SRC_FILES += \
+ target-i386/kvm.c \
+ kvm-all.c \
+ kvm-android.c
endif
##############################################################################