From patchwork Tue Aug 14 01:38:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 10564979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 52C821057 for ; Tue, 14 Aug 2018 01:39:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 436FD2944B for ; Tue, 14 Aug 2018 01:39:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 374802949C; Tue, 14 Aug 2018 01:39:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D41262944B for ; Tue, 14 Aug 2018 01:39:27 +0000 (UTC) Received: from localhost ([::1]:42041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpOIx-0007AQ-6A for patchwork-qemu-devel@patchwork.kernel.org; Mon, 13 Aug 2018 21:39:27 -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 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: 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) 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_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 @@ //#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 {