Patchwork Stop saving/restoring cpu_single_env

login
register
mail settings
Submitter Jan Kiszka
Date July 17, 2012, 3:23 p.m.
Message ID <50058375.5080009@siemens.com>
Download mbox | patch
Permalink /patch/171459/
State New
Headers show

Comments

Jan Kiszka - July 17, 2012, 3:23 p.m.
This variable is now thread-local, so cannot change anymore while
dropping the global mutex.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 cpus.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
Peter Maydell - July 17, 2012, 3:27 p.m.
On 17 July 2012 16:23, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> This variable is now thread-local, so cannot change anymore while
> dropping the global mutex.

This isn't true on any host except Linux, and run_on_cpu() isn't
inside a !_WIN32 ifdef as far as I can tell.

-- PMM
Jan Kiszka - July 17, 2012, 3:31 p.m.
On 2012-07-17 17:27, Peter Maydell wrote:
> On 17 July 2012 16:23, Jan Kiszka <jan.kiszka@siemens.com> wrote:
>> This variable is now thread-local, so cannot change anymore while
>> dropping the global mutex.
> 
> This isn't true on any host except Linux, and run_on_cpu() isn't
> inside a !_WIN32 ifdef as far as I can tell.

Err, yes, forgot that minor detail. It would also break on non-Linux Unixes.

Jan

Patch

diff --git a/cpus.c b/cpus.c
index b182b3d..733568d 100644
--- a/cpus.c
+++ b/cpus.c
@@ -660,10 +660,7 @@  void run_on_cpu(CPUArchState *env, void (*func)(void *data), void *data)
 
     qemu_cpu_kick(env);
     while (!wi.done) {
-        CPUArchState *self_env = cpu_single_env;
-
         qemu_cond_wait(&qemu_work_cond, &qemu_global_mutex);
-        cpu_single_env = self_env;
     }
 }