From: "Emilio G. Cota" <cota@braap.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
"Richard Henderson" <rth@twiddle.net>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Murilo Opsfelder Araujo" <muriloo@linux.ibm.com>
Subject: [Qemu-devel] [PATCH v2 11/12] target/i386/translate: use thread-local storage in !user-mode
Date: Mon, 10 Sep 2018 19:27:51 -0400 [thread overview]
Message-ID: <20180910232752.31565-12-cota@braap.org> (raw)
In-Reply-To: <20180910232752.31565-1-cota@braap.org>
Needed for MTTCG.
Note that in user-mode, code generation is serialized by
mmap_lock, so making these variables per-thread would
just waste TLS space.
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
---
target/i386/translate.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/target/i386/translate.c b/target/i386/translate.c
index 1f9d1d9b24..9a6a72e205 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -71,26 +71,34 @@
//#define MACRO_TEST 1
+/* we need thread-local storage for mttcg */
+#ifdef CONFIG_USER_ONLY
+#define I386_THREAD
+#else
+#define I386_THREAD __thread
+#endif
+
/* global register indexes */
-static TCGv cpu_A0;
-static TCGv cpu_cc_dst, cpu_cc_src, cpu_cc_src2, cpu_cc_srcT;
+static TCGv cpu_cc_dst, cpu_cc_src, cpu_cc_src2;
static TCGv_i32 cpu_cc_op;
static TCGv cpu_regs[CPU_NB_REGS];
static TCGv cpu_seg_base[6];
static TCGv_i64 cpu_bndl[4];
static TCGv_i64 cpu_bndu[4];
/* local temps */
-static TCGv cpu_T0, cpu_T1;
+static I386_THREAD TCGv cpu_cc_srcT;
+static I386_THREAD TCGv cpu_A0;
+static I386_THREAD TCGv cpu_T0, cpu_T1;
/* local register indexes (only used inside old micro ops) */
-static TCGv cpu_tmp0, cpu_tmp4;
-static TCGv_ptr cpu_ptr0, cpu_ptr1;
-static TCGv_i32 cpu_tmp2_i32, cpu_tmp3_i32;
-static TCGv_i64 cpu_tmp1_i64;
+static I386_THREAD TCGv cpu_tmp0, cpu_tmp4;
+static I386_THREAD TCGv_ptr cpu_ptr0, cpu_ptr1;
+static I386_THREAD TCGv_i32 cpu_tmp2_i32, cpu_tmp3_i32;
+static I386_THREAD TCGv_i64 cpu_tmp1_i64;
#include "exec/gen-icount.h"
#ifdef TARGET_X86_64
-static int x86_64_hregs;
+static I386_THREAD int x86_64_hregs;
#endif
typedef struct DisasContext {
--
2.17.1
next prev parent reply other threads:[~2018-09-10 23:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-10 23:27 [Qemu-devel] [PATCH v2 00/12] i386 + x86_64 mttcg Emilio G. Cota
2018-09-10 23:27 ` [Qemu-devel] [PATCH v2 01/12] cacheinfo: add i/d cache_linesize_log Emilio G. Cota
2018-09-11 12:16 ` Richard Henderson
2018-09-11 12:57 ` Paolo Bonzini
2018-09-10 23:27 ` [Qemu-devel] [PATCH v2 02/12] util: add atomic64 Emilio G. Cota
2018-09-11 12:43 ` Richard Henderson
2018-09-11 20:43 ` Emilio G. Cota
2018-09-10 23:27 ` [Qemu-devel] [PATCH v2 03/12] tests: add atomic64-bench Emilio G. Cota
2018-09-10 23:27 ` [Qemu-devel] [PATCH v2 04/12] qsp: use atomic64 accessors Emilio G. Cota
2018-09-10 23:27 ` [Qemu-devel] [PATCH v2 05/12] test-rcu-list: access n_reclaims and n_nodes_removed with atomic64 Emilio G. Cota
2018-09-10 23:27 ` [Qemu-devel] [PATCH v2 06/12] atomic: fix comment s/x64_64/x86_64/ Emilio G. Cota
2018-09-11 12:50 ` Richard Henderson
2018-09-10 23:27 ` [Qemu-devel] [PATCH v2 07/12] cpus: initialize timers_state.vm_clock_lock Emilio G. Cota
2018-09-11 12:50 ` Richard Henderson
2018-09-10 23:27 ` [Qemu-devel] [PATCH v2 08/12] cpus: always call seqlock_write in cpu_update_icount Emilio G. Cota
2018-09-11 12:53 ` Richard Henderson
2018-09-11 12:55 ` Paolo Bonzini
2018-09-10 23:27 ` [Qemu-devel] [PATCH v2 09/12] cpus: access .qemu_icount with atomic64 Emilio G. Cota
2018-09-10 23:27 ` [Qemu-devel] [PATCH v2 10/12] cpus: access .qemu_icount_bias " Emilio G. Cota
2018-09-10 23:27 ` Emilio G. Cota [this message]
2018-09-11 12:57 ` [Qemu-devel] [PATCH v2 11/12] target/i386/translate: use thread-local storage in !user-mode Richard Henderson
2018-09-10 23:27 ` [Qemu-devel] [PATCH v2 12/12] configure: enable mttcg for i386 and x86_64 Emilio G. Cota
2018-09-11 12:58 ` Richard Henderson
2018-09-11 13:00 ` [Qemu-devel] [PATCH v2 00/12] i386 + x86_64 mttcg Paolo Bonzini
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=20180910232752.31565-12-cota@braap.org \
--to=cota@braap.org \
--cc=alex.bennee@linaro.org \
--cc=crosthwaite.peter@gmail.com \
--cc=ehabkost@redhat.com \
--cc=muriloo@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.