summaryrefslogtreecommitdiff
path: root/cpus.c
diff options
context:
space:
mode:
authorDavid Chou <david.j.chou@intel.com>2014-11-07 17:11:56 -0800
committerKitae Kim <kt920.kim@samsung.com>2015-01-08 18:00:42 +0900
commit733c8eec316fa723c1fc59b4bb49eaa52f00c196 (patch)
tree61f286549e7afd364d1ce6c25aa0d45d1ccc7d91 /cpus.c
parentfe0e9ca7b52b338824aabd7459be6c1aeafbb8e8 (diff)
downloadqemu-733c8eec316fa723c1fc59b4bb49eaa52f00c196.tar.gz
qemu-733c8eec316fa723c1fc59b4bb49eaa52f00c196.tar.bz2
qemu-733c8eec316fa723c1fc59b4bb49eaa52f00c196.zip
Hax: added HAXM non-UG platform support back
Added HAXM non-UG platform support back. Skipped tcg initilization for UG platform with HAXM enabled. Change-Id: If909b19b4e7c4d65cb35784f86ca90b462c3302a Signed-off-by: David Chou <david.j.chou@intel.com>
Diffstat (limited to 'cpus.c')
-rw-r--r--cpus.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/cpus.c b/cpus.c
index b28a92a0f0..0b3a7c5161 100644
--- a/cpus.c
+++ b/cpus.c
@@ -512,7 +512,7 @@ void cpu_synchronize_all_post_reset(void)
CPU_FOREACH(cpu) {
cpu_synchronize_post_reset(cpu);
#ifdef CONFIG_HAX
- if (hax_enabled())
+ if (hax_enabled() && hax_ug_platform())
hax_cpu_synchronize_post_reset(cpu);
#endif
}
@@ -525,7 +525,7 @@ void cpu_synchronize_all_post_init(void)
CPU_FOREACH(cpu) {
cpu_synchronize_post_init(cpu);
#ifdef CONFIG_HAX
- if (hax_enabled())
+ if (hax_enabled() && hax_ug_platform())
hax_cpu_synchronize_post_init(cpu);
#endif
}
@@ -990,7 +990,6 @@ static void *qemu_hax_cpu_thread_fn(void *arg)
{
CPUState *cpu = arg;
int r;
-
qemu_thread_get_self(cpu->thread);
qemu_mutex_lock(&qemu_global_mutex);
@@ -1033,7 +1032,8 @@ static void qemu_cpu_kick_thread(CPUState *cpu)
if (!exit_request)
cpu_signal(0);
- cpu->exit_request = 1;
+ if (hax_enabled() && hax_ug_platform())
+ cpu->exit_request = 1;
#endif
#else /* _WIN32 */
if (!qemu_cpu_is_self(cpu)) {
@@ -1054,7 +1054,8 @@ static void qemu_cpu_kick_thread(CPUState *cpu)
}
cpu_signal(0);
- cpu->exit_request = 1;
+ if(hax_enabled() && hax_ug_platform())
+ cpu->exit_request = 1;
if (ResumeThread(cpu->hThread) == (DWORD)-1) {
fprintf(stderr, "qemu:%s: GetLastError:%lu\n", __func__,
@@ -1068,7 +1069,11 @@ static void qemu_cpu_kick_thread(CPUState *cpu)
void qemu_cpu_kick(CPUState *cpu)
{
qemu_cond_broadcast(cpu->halt_cond);
- if ((hax_enabled() || !tcg_enabled()) && !cpu->thread_kicked) {
+#ifdef CONFIG_HAX
+ if (((hax_enabled() && hax_ug_platform()) || !tcg_enabled()) && !cpu->thread_kicked) {
+#else
+ if (!tcg_enabled() && !cpu->thread_kicked) {
+#endif
qemu_cpu_kick_thread(cpu);
cpu->thread_kicked = true;
}
@@ -1100,7 +1105,11 @@ static bool qemu_in_vcpu_thread(void)
void qemu_mutex_lock_iothread(void)
{
- if (hax_enabled() || !tcg_enabled()) {
+#ifdef CONFIG_HAX
+ if ((hax_enabled() && hax_ug_platform()) || !tcg_enabled()) {
+#else
+ if (!tcg_enabled()) {
+#endif
qemu_mutex_lock(&qemu_global_mutex);
} else {
iothread_requesting_mutex = true;
@@ -1273,10 +1282,11 @@ void qemu_init_vcpu(CPUState *cpu)
cpu->nr_cores = smp_cores;
cpu->nr_threads = smp_threads;
cpu->stopped = true;
+
if (kvm_enabled()) {
qemu_kvm_start_vcpu(cpu);
#ifdef CONFIG_HAX
- } else if (hax_enabled()) {
+ } else if (hax_enabled() && hax_ug_platform()) {
qemu_hax_start_vcpu(cpu);
#endif
} else if (tcg_enabled()) {