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
diff --git a/vl-android.c b/vl-android.c
index 47b802b..0a64d0d 100644
--- a/vl-android.c
+++ b/vl-android.c
@@ -195,6 +195,9 @@
 #include "audio/audio.h"
 #include "migration.h"
 #include "kvm.h"
+#ifdef CONFIG_KVM
+#include "kvm-android.h"
+#endif
 #include "balloon.h"
 #include "android/hw-lcd.h"
 #include "android/boot-properties.h"
@@ -4047,6 +4050,11 @@
     android_hw_control_init();
     android_net_pipes_init();
 
+#ifdef CONFIG_KVM
+    /* By default, force auto-detection for kvm */
+    kvm_allowed = -1;
+#endif
+
     optind = 1;
     for(;;) {
         if (optind >= argc)
@@ -4524,16 +4532,14 @@
                 kqemu_allowed = 2;
                 break;
 #endif
-#ifdef TARGET_I386
 #ifdef CONFIG_KVM
             case QEMU_OPTION_enable_kvm:
                 kvm_allowed = 1;
-#ifdef CONFIG_KQEMU
-                kqemu_allowed = 0;
-#endif
                 break;
-#endif
-#endif  /* TARGET_I386 */
+            case QEMU_OPTION_disable_kvm:
+                kvm_allowed = 0;
+                break;
+#endif /* CONFIG_KVM */
             case QEMU_OPTION_usb:
                 usb_enabled = 1;
                 break;
@@ -5285,6 +5291,12 @@
     serial_hds_add_at(1, "android-qemud");
     stralloc_add_str(kernel_params, " android.qemud=ttyS1");
 
+#if defined(CONFIG_KVM)
+    if (kvm_allowed < 0) {
+        kvm_allowed = kvm_check_allowed();
+    }
+#endif
+
 #if defined(CONFIG_KVM) && defined(CONFIG_KQEMU)
     if (kvm_allowed && kqemu_allowed) {
         PANIC(