From 44fb41accf3f24234ea4608e97c3eddbab6ae06b Mon Sep 17 00:00:00 2001 From: Son Hyunjun Date: Thu, 12 Apr 2012 21:17:07 +0900 Subject: [PATCH] [Title] patch hax source [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 | 9 --------- target-i386/hax-all.c | 9 ++++++--- vl.c | 18 ++++++++++-------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 8def96c..76d0826 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -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, diff --git a/target-i386/hax-all.c b/target-i386/hax-all.c index fd30876..6c3354a 100644 --- a/target-i386/hax-all.c +++ b/target-i386/hax-all.c @@ -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 --- 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: { -- 2.7.4