From nobody Wed Nov 5 18:41:21 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1535995382176918.5142419143241; Mon, 3 Sep 2018 10:23:02 -0700 (PDT) Received: from localhost ([::1]:46229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwsZ3-0000Mr-3g for importer@patchew.org; Mon, 03 Sep 2018 13:23:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwsUp-00059S-Ga for qemu-devel@nongnu.org; Mon, 03 Sep 2018 13:18:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fwsUm-00077R-Ui for qemu-devel@nongnu.org; Mon, 03 Sep 2018 13:18:39 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:43811) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fwsUm-00076Z-Oo for qemu-devel@nongnu.org; Mon, 03 Sep 2018 13:18:36 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2E64421C1A; Mon, 3 Sep 2018 13:18:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 03 Sep 2018 13:18:35 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id BDB221028D; Mon, 3 Sep 2018 13:18:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=DZ9n9CniOrZ/q7 vEv3KT/R7ohYWCYk/cz25VYkoGAOQ=; b=l5queZkOSqnEZLNBhunXQtP1r7bTCi wPWHxaw+gAMakyhW48qhyeczidHlrkJ+ljJiiL0xQJUyGSJKjJIlaubGmdGlHReb oC+v6vajBwpksG42k/JWWVe3Kdrv9OvLkahNZ90kZYfSciTqtr2dI9PDzAkl3yuC rmLOTsgBKkCBE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=DZ9n9CniOrZ/q7vEv3KT/R7ohYWCYk/cz25VYkoGAOQ=; b=MNr03CAs HsA7/aJvdOELJghmZUSulCsWDk31bwXQSIFSfyryKRnD0hDLJG5yF3WUTE0J2dN2 4hAa/xoNUMvk3WlqsKyqPUB29NV6d+9941KruTpRUIEv0GjcOBiIriU559FvnhUh qeWbLx+h7mw5MDiBkihjHeenJ2qwbSTG4J1h8PiERE55U3Qi5d7zs+1b9ADGlwZA eq9HmbEZYZTkeehNyd3KPA6zV6lPbS1uXBtLRQURqkpb6D5pwU3vxpiee+MMwe+T 4+25u7nPujG89sktMHq099LL0B/jTX97sv9VLAKdoWh658M0ThQfSyzo/3VnSJ/5 99dLpwOSre4pjg== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 3 Sep 2018 13:18:30 -0400 Message-Id: <20180903171831.15446-6-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903171831.15446-1-cota@braap.org> References: <20180903171831.15446-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH 5/6] target/i386/translate: use thread-local storage in !user-mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eduardo Habkost , Peter Crosthwaite Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Needed for MTTCG. Signed-off-by: Emilio G. Cota Acked-by: Alex Benn=C3=A9e --- 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 @@ =20 //#define MACRO_TEST 1 =20 +/* 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; =20 #include "exec/gen-icount.h" =20 #ifdef TARGET_X86_64 -static int x86_64_hregs; +static I386_THREAD int x86_64_hregs; #endif =20 typedef struct DisasContext { --=20 2.17.1