Patchwork [for-1.4,v3] linux-user: bsd-user: Don't reset X86CPU twice

login
register
mail settings
Submitter Andreas Färber
Date Jan. 31, 2013, 8:40 p.m.
Message ID <1359664840-4160-1-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/217254/
State New
Headers show

Comments

Andreas Färber - Jan. 31, 2013, 8:40 p.m.
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. Clean this up.

Similarly it is also reset after cpu_copy(), but that's a bug of its own.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 v2 -> v3:
 * Don't touch cpu_copy() at all, only fixing the double reset
   and not changing cpu_copy() behavior.

 v1 -> v2:
 * First move cpu_reset() into cpu_copy() before dropping x86 reset.

 bsd-user/main.c   |    2 +-
 linux-user/main.c |    2 +-
 2 Dateien geändert, 2 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)
Andreas Färber - Feb. 1, 2013, 12:06 a.m.
Am 31.01.2013 21:40, schrieb Andreas Färber:
> 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. Clean this up.
> 
> Similarly it is also reset after cpu_copy(), but that's a bug of its own.
> 
> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  v2 -> v3:
>  * Don't touch cpu_copy() at all, only fixing the double reset
>    and not changing cpu_copy() behavior.

Applied this stripped-down version to qom-cpu:
https://github.com/afaerber/qemu-cpu/commits/qom-cpu

Andreas

Patch

diff --git a/bsd-user/main.c b/bsd-user/main.c
index 1dc0330..ae24723 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -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;
diff --git a/linux-user/main.c b/linux-user/main.c
index 0181bc2..3df8aa2 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -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