From: "Andreas Färber" <afaerber@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
"Dr. David Alan Gilbert" <david.gilbert@linaro.org>,
qemu-devel@nongnu.org, Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] Make cpu_single_env thread-local
Date: Wed, 26 Oct 2011 18:20:08 +0200 [thread overview]
Message-ID: <4EA83338.5030400@suse.de> (raw)
In-Reply-To: <1319645231-14151-3-git-send-email-peter.maydell@linaro.org>
Am 26.10.2011 18:07, schrieb Peter Maydell:
> From: Paolo Bonzini <pbonzini@redhat.com>
>
> Make cpu_single_env thread-local. This fixes a regression
> in handling of multi-threaded programs in linux-user mode
> (bug 823902).
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> cpu-all.h | 4 +++-
> darwin-user/main.c | 2 --
> exec.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> 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
>
> #include "qemu-common.h"
> +#include "qemu-tls.h"
> #include "cpu-common.h"
>
> /* some important defines:
> @@ -334,7 +335,8 @@ void cpu_dump_statistics(CPUState *env, FILE *f, fprintf_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)
>
> /* XXX: currently only used for async signals (see signal.c) */
> CPUState *global_env;
> -/* used only if single thread */
> -CPUState *cpu_single_env = NULL;
>
> /* 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
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2011-10-26 16:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-26 16:07 [Qemu-devel] [PATCH 0/2] TLS abstraction layer for thread-local cpu_single_env on Linux Peter Maydell
2011-10-26 16:07 ` [Qemu-devel] [PATCH 1/2] qemu-tls.h: Add abstraction layer for TLS variables Peter Maydell
2011-10-26 17:08 ` Paolo Bonzini
2011-10-26 17:38 ` Peter Maydell
2011-10-26 16:07 ` [Qemu-devel] [PATCH 2/2] Make cpu_single_env thread-local Peter Maydell
2011-10-26 16:20 ` Andreas Färber [this message]
2011-10-26 16:58 ` 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=4EA83338.5030400@suse.de \
--to=afaerber@suse.de \
--cc=david.gilbert@linaro.org \
--cc=jan.kiszka@siemens.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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).