Skip to contentSkip to conversation

*-user: Don't reset X86CPU again

PATCH New Andreas Färber 1 participant 1 message Jan 20, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 *-user: Don't reset X86CPU again

Since commit 65dee38052597b6285eb208125369f01b29ba6c1 (target-i386:
move cpu_reset and reset callback to cpu.c) the x86 CPU is reset through cpu_init() but was still reset immediately after in linux-user and bsd-user. Similarly it was reset again in linux-user after cpu_copy(), defeating its very purpose. Clean this up.

Fixing the ppc and sparc cases of cpu_copy() and overhauling its implementation is left for another day.

Cc Igor Mammedov <[email protected]>
Cc Peter Maydell <[email protected]>
---
 bsd-user/main.c      |    2 +-
 linux-user/main.c    |    2 +-
 linux-user/syscall.c |    2 +-

3 Dateien geändert, 3 Zeilen hinzugefügt(+), 3 Zeilen entfernt(-)

bsd-user/main.c +1 -1
index 1dc0330..ae24723 100644
@@ -917,7 +917,7 @@ 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)
+#if defined(TARGET_SPARC) || defined(TARGET_PPC)
     cpu_reset(ENV_GET_CPU(env));
 #endif
     thread_env = env;
linux-user/main.c +1 -1
index 0181bc2..3df8aa2 100644
@@ -3540,7 +3540,7 @@ 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)
+#if defined(TARGET_SPARC) || defined(TARGET_PPC)
     cpu_reset(ENV_GET_CPU(env));
 #endif
 
linux-user/syscall.c +1 -1
index 693e66f..7be6144 100644
@@ -4361,7 +4361,7 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp,
         init_task_state(ts);
         /* we create a new CPU instance. */
         new_env = cpu_copy(env);
-#if defined(TARGET_I386) || defined(TARGET_SPARC) || defined(TARGET_PPC)
+#if defined(TARGET_SPARC) || defined(TARGET_PPC)
         cpu_reset(ENV_GET_CPU(new_env));
 #endif
         /* Init regs that differ from the parent.  */
Signature · 1 line
1.7.10.4