From nobody Wed Nov 5 11:42:11 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.zoho.com; dkim=fail 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 1498849929372207.25264579145346; Fri, 30 Jun 2017 12:12:09 -0700 (PDT) Received: from localhost ([::1]:45670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dR1Kj-0008BX-WA for importer@patchew.org; Fri, 30 Jun 2017 15:12:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dR1Hz-0006Us-QT for qemu-devel@nongnu.org; Fri, 30 Jun 2017 15:09:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dR1Hy-00036j-Md for qemu-devel@nongnu.org; Fri, 30 Jun 2017 15:09:11 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:36122) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dR1Hy-000363-Ho for qemu-devel@nongnu.org; Fri, 30 Jun 2017 15:09:10 -0400 Received: by mail-qk0-x243.google.com with SMTP id v143so3780410qkb.3 for ; Fri, 30 Jun 2017 12:09:10 -0700 (PDT) Received: from bigtime.twiddle.net.com (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id g25sm7454446qte.57.2017.06.30.12.09.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jun 2017 12:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=PEWrs6e9wYb6WEv532mkYkOBWejEE2rqWcZ8vozKvKk=; b=qbBRlVaO+2RJBeqb4A/FcQqASdMGFvu720QGR0xbf5gKYyhKLmU3dEZhbfBeOGaKNj ZZvEdt096H4y8i2vI6QXODFaPCa6FuDj+udIHXz1Ai1pGAp8TVo0/9uHKE9e3TQMrgxD T3+MrSY43M4kr1B5tA06ICNVTYf0Bj3DGK2EKZ0qm5qWGcONYu15LOTTKPohQXSl9j2O o197r52ACBvd6fOCcpfCWj6mNWYNZiY7xEG+kbJN/1ZhnEQjVmfGHd9uW9t7jPLBi+ZJ N+z15ZS24f/7MCJJ15vxzGXvE46Lgy/JVAuAcZhswUN12Cpo/74be5e5G5RsBzoSvIzr h33A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=PEWrs6e9wYb6WEv532mkYkOBWejEE2rqWcZ8vozKvKk=; b=GhbANBfau+qrOFlfzzPHtQSESPQgTv1uRDdoh4i+Cu7G45nDxrvA6jFPdv7nLyOGEU YmQ325xUYPwtoHFXu+xIBj6u78xvFx5H8n1wFBvfK8/PryJnp2am+SnZ8wyOHbnih037 fGQPvzjZZ05m0o+jF1568Qw/yOl2O6yVFtZ3/ZvmHzeBqelc2CJ7ETjlCtcXcXD5ziOB ye0zAJj1VmBqG5n6GSYYUXlUmyqWxCLK08A3iJf5fRAmG+j9gsmHXYRsaSg0pfis8Dv4 xRimcCjoQGRLLzTGpBNFvRQH/2JhaIkMFU+5P4U+zZnUPeQZRlF28AHuniSA0GTFKuOi 8yFA== X-Gm-Message-State: AKS2vOziH2gR+W3MWgUc/svoMWg3+Mi/AhPTzcK5uuNsD3HKVNAPTT15 dYvQYHJ5vWz7xzRLwTo= X-Received: by 10.55.198.156 with SMTP id s28mr27692941qkl.222.1498849749849; Fri, 30 Jun 2017 12:09:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 30 Jun 2017 12:09:02 -0700 Message-Id: <20170630190903.9886-3-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170630190903.9886-1-rth@twiddle.net> References: <20170630190903.9886-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PULL 2/3] gen-icount: use tcg_ctx.tcg_env instead of cpu_env 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: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Emilio G. Cota" We are relying on cpu_env being defined as a global, yet most targets (i.e. all but arm/a64) have it defined as a local variable. Luckily all of them use the same "cpu_env" name, but really compilation shouldn't break if the name of that local variable changed. Fix it by using tcg_ctx.tcg_env, which all targets set in their translate_init function. This change also helps paving the way for the upcoming "translation loop common to all targets" work. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Message-Id: <1497639397-19453-3-git-send-email-cota@braap.org> Signed-off-by: Richard Henderson --- include/exec/gen-icount.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h index 547c979..9b3cb14 100644 --- a/include/exec/gen-icount.h +++ b/include/exec/gen-icount.h @@ -19,7 +19,7 @@ static inline void gen_tb_start(TranslationBlock *tb) count =3D tcg_temp_new_i32(); } =20 - tcg_gen_ld_i32(count, cpu_env, + tcg_gen_ld_i32(count, tcg_ctx.tcg_env, -ENV_OFFSET + offsetof(CPUState, icount_decr.u32)); =20 if (tb->cflags & CF_USE_ICOUNT) { @@ -37,7 +37,7 @@ static inline void gen_tb_start(TranslationBlock *tb) tcg_gen_brcondi_i32(TCG_COND_LT, count, 0, exitreq_label); =20 if (tb->cflags & CF_USE_ICOUNT) { - tcg_gen_st16_i32(count, cpu_env, + tcg_gen_st16_i32(count, tcg_ctx.tcg_env, -ENV_OFFSET + offsetof(CPUState, icount_decr.u16.= low)); } =20 @@ -62,14 +62,16 @@ static inline void gen_tb_end(TranslationBlock *tb, int= num_insns) static inline void gen_io_start(void) { TCGv_i32 tmp =3D tcg_const_i32(1); - tcg_gen_st_i32(tmp, cpu_env, -ENV_OFFSET + offsetof(CPUState, can_do_i= o)); + tcg_gen_st_i32(tmp, tcg_ctx.tcg_env, + -ENV_OFFSET + offsetof(CPUState, can_do_io)); tcg_temp_free_i32(tmp); } =20 static inline void gen_io_end(void) { TCGv_i32 tmp =3D tcg_const_i32(0); - tcg_gen_st_i32(tmp, cpu_env, -ENV_OFFSET + offsetof(CPUState, can_do_i= o)); + tcg_gen_st_i32(tmp, tcg_ctx.tcg_env, + -ENV_OFFSET + offsetof(CPUState, can_do_io)); tcg_temp_free_i32(tmp); } =20 --=20 2.9.4