aboutsummaryrefslogtreecommitdiffstats
path: root/target-i386/hax-interface.h
diff options
context:
space:
mode:
authorJiang, Yunhong <yunhong.jiang@intel.com>2012-02-23 06:31:12 +0800
committerJiang, Yunhong <yunhong.jiang@intel.com>2012-02-23 23:11:12 +0800
commit4a5a0efd49f100c7d53920807c83d9c74304ecd8 (patch)
tree44b171204d5d07b8ec4c2788cf107fa63fd4c211 /target-i386/hax-interface.h
parenta3338e7214cd0c69912866c6d71d8700c6ab35e2 (diff)
downloadexternal_qemu-4a5a0efd49f100c7d53920807c83d9c74304ecd8.zip
external_qemu-4a5a0efd49f100c7d53920807c83d9c74304ecd8.tar.gz
external_qemu-4a5a0efd49f100c7d53920807c83d9c74304ecd8.tar.bz2
Check HAXM capability in QEMU
Checking HAXM capability to check if emulator can use HAXM virtalization. Currently two possibility that HAXM not work. Firstly is VT/NX is not enabled in the system, seconly is HAXM have used up the memory quota. See code comemnts for the memry quota explaination. Checking the capability in advance can give user more information that why HAXM is not working and be more user friendly. Change-Id: I13f73734cf783398f485fabd19cce43364b571c3 Signed-off-by: Xin, Xiaohui <xiaohui.xin@intel.com> Signed-off-by: Gao, Fengqian <fengqian.gao@intel.com> Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Diffstat (limited to 'target-i386/hax-interface.h')
-rw-r--r--target-i386/hax-interface.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/target-i386/hax-interface.h b/target-i386/hax-interface.h
index 5a9ed31..569eeba 100644
--- a/target-i386/hax-interface.h
+++ b/target-i386/hax-interface.h
@@ -347,4 +347,39 @@ struct hax_set_ram_info
uint64_t va;
};
+/*
+ * We need to load the HAXM (HAX Manager) to tell if the host system has the
+ * required capabilities to operate, and we use hax_capabilityinfo to get such
+ * info from HAXM.
+ *
+ * To prevent HAXM from over-consuming RAM, we set the maximum amount of RAM
+ * that can be used for guests at HAX installation time. Once the quota is
+ * reached, HAXM will no longer attempt to allocate memory for guests.
+ * Detect that HAXM is out of quota can take the emulator to non-HAXM model
+ */
+struct hax_capabilityinfo
+{
+ /* bit 0: 1 - HAXM is working
+ * 0 - HAXM is not working possibly because VT/NX is disabled
+ NX means Non-eXecution, aks. XD (eXecution Disable)
+ * bit 1: 1 - HAXM has hard limit on how many RAM can be used as guest RAM
+ * 0 - HAXM has no memory limitation
+ */
+#define HAX_CAP_STATUS_WORKING 0x1
+#define HAX_CAP_STATUS_NOTWORKING 0x0
+#define HAX_CAP_WORKSTATUS_MASK 0x1
+#define HAX_CAP_MEMQUOTA 0x2
+ uint16_t wstatus;
+ /*
+ * valid when HAXM is not working
+ * bit 0: HAXM is not working because VT is not enabeld
+ * bit 1: HAXM is not working because NX not enabled
+ */
+#define HAX_CAP_FAILREASON_VT 0x1
+#define HAX_CAP_FAILREASON_NX 0x2
+ uint16_t winfo;
+ uint32_t pad;
+ uint64_t mem_quota;
+};
+
#endif