qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: riku.voipio@linaro.org
To: qemu-devel@nongnu.org
Cc: Leon Alrae <leon.alrae@imgtec.com>
Subject: [Qemu-devel] [PULL 3/3] linux-user: fix broken cpu_copy()
Date: Mon, 23 Mar 2015 15:54:55 +0200	[thread overview]
Message-ID: <61c7480fa36775cc2baa2f8141f0c64a15f827b5.1427118794.git.riku.voipio@linaro.org> (raw)
In-Reply-To: <cover.1427118794.git.riku.voipio@linaro.org>

From: Leon Alrae <leon.alrae@imgtec.com>

New threads always point at the same env which is incorrect and usually
leads to a crash.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 linux-user/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/main.c b/linux-user/main.c
index 31eb60f..a8adb04 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3451,7 +3451,7 @@ CPUArchState *cpu_copy(CPUArchState *env)
 {
     CPUState *cpu = ENV_GET_CPU(env);
     CPUState *new_cpu = cpu_init(cpu_model);
-    CPUArchState *new_env = cpu->env_ptr;
+    CPUArchState *new_env = new_cpu->env_ptr;
     CPUBreakpoint *bp;
     CPUWatchpoint *wp;
 
-- 
2.1.4

  parent reply	other threads:[~2015-03-23 13:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 13:54 [Qemu-devel] [PULL 0/3] linux-user patches for 2.3-rc1 riku.voipio
2015-03-23 13:54 ` [Qemu-devel] [PULL 1/3] linux-user/main.c: Remove redundant end_exclusive() in arm_kernel_cmpxchg64_helper() riku.voipio
2015-03-23 13:54 ` [Qemu-devel] [PULL 2/3] linux-user: fix emulation of splice syscall riku.voipio
2015-03-23 13:54 ` riku.voipio [this message]
2015-03-23 17:01 ` [Qemu-devel] [PULL 0/3] linux-user patches for 2.3-rc1 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61c7480fa36775cc2baa2f8141f0c64a15f827b5.1427118794.git.riku.voipio@linaro.org \
    --to=riku.voipio@linaro.org \
    --cc=leon.alrae@imgtec.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).