aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bsd-user/main.c3
-rw-r--r--darwin-user/main.c1
-rw-r--r--linux-user/main.c4
-rw-r--r--target-i386/helper.c3
-rw-r--r--target-ppc/helper.c3
-rw-r--r--target-sparc/helper.c3
6 files changed, 8 insertions, 9 deletions
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 19b7f3a1f7..9f8683d2e6 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -891,6 +891,9 @@ int main(int argc, char **argv)
fprintf(stderr, "Unable to find CPU definition\n");
exit(1);
}
+#if defined(TARGET_I386) || defined(TARGET_SPARC) || defined(TARGET_PPC)
+ cpu_reset(env);
+#endif
thread_env = env;
if (getenv("QEMU_STRACE")) {
diff --git a/darwin-user/main.c b/darwin-user/main.c
index 9f0e0149f3..5fd314ecd9 100644
--- a/darwin-user/main.c
+++ b/darwin-user/main.c
@@ -846,6 +846,7 @@ int main(int argc, char **argv)
/* NOTE: we need to init the CPU at this stage to get
qemu_host_page_size */
env = cpu_init(cpu_model);
+ cpu_reset(env);
printf("Starting %s with qemu\n----------------\n", filename);
diff --git a/linux-user/main.c b/linux-user/main.c
index 81a1ada50b..bcc36f256b 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2618,6 +2618,10 @@ int main(int argc, char **argv, char **envp)
fprintf(stderr, "Unable to find CPU definition\n");
exit(1);
}
+#if defined(TARGET_I386) || defined(TARGET_SPARC) || defined(TARGET_PPC)
+ cpu_reset(env);
+#endif
+
thread_env = env;
if (getenv("QEMU_STRACE")) {
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 3fff1bbed1..957b3fc1f2 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1885,9 +1885,6 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
return NULL;
}
mce_init(env);
-#ifdef CONFIG_USER_ONLY
- cpu_reset(env);
-#endif
qemu_init_vcpu(env);
diff --git a/target-ppc/helper.c b/target-ppc/helper.c
index 8d383e0d5a..b233d4f535 100644
--- a/target-ppc/helper.c
+++ b/target-ppc/helper.c
@@ -2810,9 +2810,6 @@ CPUPPCState *cpu_ppc_init (const char *cpu_model)
ppc_translate_init();
env->cpu_model_str = cpu_model;
cpu_ppc_register_internal(env, def);
-#if defined(CONFIG_USER_ONLY)
- cpu_reset(env);
-#endif
qemu_init_vcpu(env);
diff --git a/target-sparc/helper.c b/target-sparc/helper.c
index b8e7a5e12b..d83ba139b3 100644
--- a/target-sparc/helper.c
+++ b/target-sparc/helper.c
@@ -762,9 +762,6 @@ CPUSPARCState *cpu_sparc_init(const char *cpu_model)
cpu_sparc_close(env);
return NULL;
}
-#if defined(CONFIG_USER_ONLY)
- cpu_reset(env);
-#endif
qemu_init_vcpu(env);
return env;