From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJ6DG-0005r9-T1 for qemu-devel@nongnu.org; Wed, 26 Oct 2011 12:20:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJ6DF-000056-SQ for qemu-devel@nongnu.org; Wed, 26 Oct 2011 12:20:22 -0400 Received: from cantor2.suse.de ([195.135.220.15]:55291 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJ6DF-0008WP-Aa for qemu-devel@nongnu.org; Wed, 26 Oct 2011 12:20:21 -0400 Message-ID: <4EA83338.5030400@suse.de> Date: Wed, 26 Oct 2011 18:20:08 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1319645231-14151-1-git-send-email-peter.maydell@linaro.org> <1319645231-14151-3-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1319645231-14151-3-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/2] Make cpu_single_env thread-local List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , qemu-devel@nongnu.org, Jan Kiszka Am 26.10.2011 18:07, schrieb Peter Maydell: > From: Paolo Bonzini >=20 > Make cpu_single_env thread-local. This fixes a regression > in handling of multi-threaded programs in linux-user mode > (bug 823902). >=20 > Signed-off-by: Paolo Bonzini > --- > cpu-all.h | 4 +++- > darwin-user/main.c | 2 -- > exec.c | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/cpu-all.h b/cpu-all.h > index 42a5fa0..e37ebfc 100644 > --- a/cpu-all.h > +++ b/cpu-all.h > @@ -20,6 +20,7 @@ > #define CPU_ALL_H > =20 > #include "qemu-common.h" > +#include "qemu-tls.h" > #include "cpu-common.h" > =20 > /* some important defines: > @@ -334,7 +335,8 @@ void cpu_dump_statistics(CPUState *env, FILE *f, fp= rintf_function cpu_fprintf, > void QEMU_NORETURN cpu_abort(CPUState *env, const char *fmt, ...) > GCC_FMT_ATTR(2, 3); > extern CPUState *first_cpu; > -extern CPUState *cpu_single_env; > +DECLARE_TLS(CPUState *,tls_cpu_single_env); So this effectively becomes tls__tls_cpu_single_env iiuc. For compile-checking for missed conversions, DECLARE_TLS(CPUState *,cpu_single_env); should do, no? > diff --git a/darwin-user/main.c b/darwin-user/main.c > index 1a881a0..c0f14f8 100644 > --- a/darwin-user/main.c > +++ b/darwin-user/main.c > @@ -729,8 +729,6 @@ static void usage(void) > =20 > /* XXX: currently only used for async signals (see signal.c) */ > CPUState *global_env; > -/* used only if single thread */ > -CPUState *cpu_single_env =3D NULL; > =20 > /* used to free thread contexts */ > TaskState *first_task_state; This is not making anything local, it's apparently removing an unused variable. Can we then have that in a patch saying so, please? Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg