[Title] patch hax source
authorSon Hyunjun <hj79.son@samsung.com>
Thu, 12 Apr 2012 12:17:07 +0000 (21:17 +0900)
committerSon Hyunjun <hj79.son@samsung.com>
Thu, 12 Apr 2012 12:17:07 +0000 (21:17 +0900)
[Type] Enhancement
[Module] Hax
[Priority] Major
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution] modify about disable hax and memory space error

Change-Id: Ie359eceece20b347c75a9fa9746ec59ad0015f27

qemu-options.hx
target-i386/hax-all.c
vl.c

index 8def96c..76d0826 100644 (file)
@@ -2264,15 +2264,6 @@ Enable HAX (Hardware-based Acceleration eXecution) support. When HAX support det
 HAX is only supported in MAC and Windows platform and is not conflict with KVM.
 ETEXI
 
-DEF("disable-hax", 0, QEMU_OPTION_disable_hax, \
-    "-disable-hax   Disable HAX full virtualization support\n", QEMU_ARCH_I386)
-STEXI
-@item -disable-hax
-@findex -disable-hax
-Disable HAX (Hardware-based Acceleration eXecution) support. When HAX support detected, emulator will enable it by default. This option will disable the default action
-HAX is only supported in MAC and Windows platform and is not conflict with KVM.
-ETEXI
-
 DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
     "-xen-domid id   specify xen guest domain id\n", QEMU_ARCH_ALL)
 DEF("xen-create", 0, QEMU_OPTION_xen_create,
index fd30876..6c3354a 100644 (file)
@@ -424,10 +424,13 @@ int hax_init(void)
         goto error;
     }
 
-    if (hax_get_capability(hax))
+    ret = hax_get_capability(hax);
+
+    if (ret)
     {
+       if (ret != -ENOSPC)
            ret = -EINVAL;
-           goto error;
+       goto error;
     }
 
     if (!hax_version_support(hax))
@@ -450,7 +453,7 @@ int hax_init(void)
 
     hax_support = 1;
 
-    return 0;
+    return ret;
 error:
     if (hax->vm)
         hax_vm_destroy(hax->vm);
diff --git a/vl.c b/vl.c
index 1b3ad04..17dcd5b 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -237,7 +237,7 @@ const char *vnc_display;
 #endif
 int acpi_enabled = 1;
 int no_hpet = 0;
-int hax_disabled = 0;
+int hax_disabled = 1;
 int fd_bootchk = 1;
 int no_reboot = 0;
 int no_shutdown = 0;
@@ -2050,13 +2050,19 @@ static int tcg_init(void)
     if (!hax_disabled)
     {
        ret = hax_init();
-       dprint("HAX is %s and emulator runs in %s mode\n",
-               !ret ? "working" : "not working",
+       if (ret && (ret != -ENOSPC))
+               dprint("No accelerator found.\n");
+       else {
+               dprint("HAX is %s and emulator runs in %s mode.\n", 
+               !ret ? "working" : "not working", 
                !ret ? "fast virt" : "emulation");
+               return 0;
+       }
+
     } else
        dprint("HAX is disabled and emulator runs in emulation mode.\n");
 #endif 
-    return 0;
+    return ret;
 }
 
 static struct {
@@ -2069,7 +2075,6 @@ static struct {
     { "tcg", "tcg", tcg_available, tcg_init, &tcg_allowed },
     { "xen", "Xen", xen_available, xen_init, &xen_allowed },
     { "kvm", "KVM", kvm_available, kvm_init, &kvm_allowed },
-    //{ "hax", "HAX", hax_available, hax_init, &hax_allowed },
 };
 
 static int configure_accelerator(void)
@@ -3169,9 +3174,6 @@ int main(int argc, char **argv, char **envp)
                 qemu_opts_reset(olist);
                 //qemu_opts_parse(olist, "accel=hax", 0);
                 break;
-            case QEMU_OPTION_disable_hax:
-                hax_disabled = 1;
-                break;
 #ifdef CONFIG_MARU
             case QEMU_OPTION_max_touch_point:
                 {