check if UG support from haxm 16/25316/1
authorliucm <chunmei.liu@intel.com>
Sat, 2 Aug 2014 00:46:43 +0000 (17:46 -0700)
committerliucm <chunmei.liu@intel.com>
Sat, 2 Aug 2014 00:51:48 +0000 (17:51 -0700)
Change-Id: Idb9a0aeca647903aadcbfe5d38e46f29817f37f6

target-i386/hax-all.c
target-i386/hax-interface.h

index 9b9449f2aeece027bd590b8e646e79c6bc994eb7..388e99d7d35fd78ba383d74b24b6903dd9226c3e 100644 (file)
@@ -44,6 +44,8 @@ static int hax_disabled = 1;
 
 int hax_support = -1;
 
+int ug_support = 0;
+
 /* Called after hax_init */
 int hax_enabled(void)
 {
@@ -168,6 +170,9 @@ static int hax_get_capability(struct hax_state *hax)
         return -ENXIO;
     }
 
+    if (cap->winfo & HAX_CAP_UG)
+       ug_support = 1;
+
     if (cap->wstatus & HAX_CAP_MEMQUOTA)
     {
         if (cap->mem_quota < hax->mem_quota)
@@ -644,13 +649,12 @@ static int hax_vcpu_hax_exec(CPUArchState *env)
     struct hax_vcpu_state *vcpu = cpu->hax_vcpu;
     struct hax_tunnel *ht = vcpu->tunnel;
 
-    if (hax_vcpu_emulation_mode(env))
+    if (!ug_support && hax_vcpu_emulation_mode(env))
     {
         dprint("Trying to vcpu execute at eip:%lx\n", env->eip);
         return  HAX_EMUL_EXITLOOP;
     }
 
-    
     //hax_cpu_synchronize_state(env);
 
     do {
@@ -784,7 +788,7 @@ int hax_vcpu_exec(CPUArchState *env)
     struct hax_vcpu_state *vcpu;
     CPUState *cpu = ENV_GET_CPU(env);
 
-    if (cpu->hax_vcpu->emulation_state != HAX_EMULATE_STATE_NONE)
+    if (!ug_support && cpu->hax_vcpu->emulation_state != HAX_EMULATE_STATE_NONE)
         return 1;
 
     vcpu = cpu->hax_vcpu;
index ca0f958ca6b144f5a88c41ce9649f0fe9cfbc6ae..dd49683639cef9be8f68be570e04d556450f6a38 100644 (file)
@@ -328,6 +328,7 @@ struct hax_set_ram_info
 #define HAX_CAP_FAILREASON_NX   0x2
 
 #define HAX_CAP_MEMQUOTA       0x2
+#define HAX_CAP_UG          0x4
 
 struct hax_capabilityinfo
 {