From nobody Wed Nov 5 10:12:07 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 1534210797417238.3528554681351; Mon, 13 Aug 2018 18:39:57 -0700 (PDT) Received: from localhost ([::1]:42041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpOJP-0007AQ-VP for importer@patchew.org; Mon, 13 Aug 2018 21:39:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpOHm-0006H2-PZ for qemu-devel@nongnu.org; Mon, 13 Aug 2018 21:38:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpOHj-0002GO-KS for qemu-devel@nongnu.org; Mon, 13 Aug 2018 21:38:14 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:56313) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fpOHj-0002Fy-Ec for qemu-devel@nongnu.org; Mon, 13 Aug 2018 21:38:11 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E8A0B21EA7; Mon, 13 Aug 2018 21:38:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 13 Aug 2018 21:38:10 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 86E67E47E1; Mon, 13 Aug 2018 21:38:10 -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=uCFoU/H7u6ERFf lRlK3INhullJAAlOWFLzzHCe/nvQY=; b=2TGjMNrDyUdGu4UX8gh9JbmGn/5MVS 04qBYyaaTfNzdVIbyrxg/LxI8SPVvdIhk9r3PU1NG5yr4ZRIkkRzsO3y4hfvb9Cw Te1qsERlXSDtGrxWLN48k/bXnbVDfto40m4pvQ7Fwa8gkriyFf5OCVzbj0uLQbaA 4PmKuuMCx7huw= 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=uCFoU/H7u6ERFflRlK3INhullJAAlOWFLzzHCe/nvQY=; b=AErU2jyZ 1DRG4NQE2sm8IBUfLHSHAbq2Eq/JdYDmKJWlLpYkmHuYND3TMjZ2ILJaBQHOHfNh 4vEjNqc9P9YABKFVvMpjdza6vvfzak108qsPz/ulzkyx9LndkTlnnE0w8kMCEeWh A1kfouojXbaMdNtozMYt8B9Wu41Sa06glcWfgEOXMI97WSRK8bf8qeIVOLOHI6s8 cal1u0o7BTlMfdw+a0/eQ7jlqpgEgN5+JJSA4zAY5Kl8VALY3Fo6IyTLEr5pSIjO S19w9y3pT6bYP+y08QqE+bAOHV7ICupfq7WWR6R23XAjigYOSupfVrd1NPs+qo/v 5mfaqmYCo0K26g== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 13 Aug 2018 21:38:00 -0400 Message-Id: <20180814013801.26036-4-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180814013801.26036-1-cota@braap.org> References: <20180814013801.26036-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 3/4] 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: Eduardo Habkost , "Michael S . Tsirkin" , Peter Crosthwaite , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson 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 --- 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 07d185e7b6..f4c2a41f8f 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