From nobody Sat Sep 28 22:17:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1610051313; cv=none; d=zohomail.com; s=zohoarc; b=nG2zphu00AWwkAyNEkUl/CGmvt+6jFvdL7druJ+Yp4QPcUEKxWlTjDAocxjkUkJVtGP8RyQd5lOsp+mxRNJJg/bnhPtPesnUOEvdqFSep/KXjzdUUikzs9de7LO+PJqwBZLFLzKFyIUgnHPitzpEOrgE+TKwBjNOephNpCVBoMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610051313; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=E8w1jAPv5ZMwC9hUfY2h/aIQICFcgu6SGeTKeYT6t3w=; b=b9a2mlf1rVaSkwzVqjyuj4PKWN/ABHJb/3fVHyNe+dXKIoV9TJ7fKNCyUxuR4//t3yhKS6bYNQ2OKTRlidRpNnjERyl6n8gvGgd+rBmv8b/NOoPkR5a8ck4WBKT3sFJ+Zl8VbXgFg6XTUFmgQYseBZZlO3nlcbn4QR84kFOkv58= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16100513131367.0752199236764; Thu, 7 Jan 2021 12:28:33 -0800 (PST) Received: from localhost ([::1]:56936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxbtY-0000Ed-1r for importer@patchew.org; Thu, 07 Jan 2021 15:28:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxbh3-0001GT-5Z for qemu-devel@nongnu.org; Thu, 07 Jan 2021 15:15:37 -0500 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:33791) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kxbgs-0001b7-RS for qemu-devel@nongnu.org; Thu, 07 Jan 2021 15:15:36 -0500 Received: by mail-pg1-x534.google.com with SMTP id n25so5759130pgb.0 for ; Thu, 07 Jan 2021 12:15:25 -0800 (PST) Received: from localhost.localdomain (rrcs-173-197-107-21.west.biz.rr.com. [173.197.107.21]) by smtp.gmail.com with ESMTPSA id v6sm6516265pfi.31.2021.01.07.12.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jan 2021 12:15:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E8w1jAPv5ZMwC9hUfY2h/aIQICFcgu6SGeTKeYT6t3w=; b=XUwSh5CDfgJyOtXyayoEkPrl9/O2hNhd+PghLTD6EvUpCZKC+HKExv3TeH0GkZSDsQ KyD+PSnaHNtxeozLpQ02nIjGutRaWEMQNJjnsR8HhVw7uqrucRXLmDCICvNAvRn+k5/G bu125UgukkFMVo0QLMk+2viGB/WFv64UJA7OFr8i4zv1BfJgLfUma7lwWLkIW93dY+yl q4P+uWrY29wqriMWntqhcc4wvsCjKeSiw+/ojxuGDev+DaAzRDnqLca4gKf94JKa0wYf EYVuzjhcTn7gSalvEJdb8bFxovlbDy2Bxx/0Q9WrcEgMqYaTYUlzwXEK6k19zwHfXZ70 Fhgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E8w1jAPv5ZMwC9hUfY2h/aIQICFcgu6SGeTKeYT6t3w=; b=q1yERoUTGxeu23R/4IxX+fcn5xpTN3wn7tdVOB7lAWQiD4mPaBUw+6y1wuCZsCyx6C 5PyOVyQhDnbCr2yJAWCfK5a0TXiKyjCvU7miUVMrQND4HbCeCdYTDEHu1R1Ll2HfZMKB gcRF0QPgHEj2sFMrq6K1DSn72aDL51WlWoKZgYAw3MMy7aRfQFw3HLAR3Ff34SVcdETo FyoGZh7ZuUldOBZOsxPf5tI+sVEJponBbXzZjR5awN0s8qkyhjeM08vsRf4T34tMKwIC 559ZTcVuFreuTUlLBSpIS6+I00v67zHN1ypeS3JKKo0LFnJuhNgBkFDrNKRI1dfpENE0 cKzA== X-Gm-Message-State: AOAM5315SdpYOv2KWcfE12JMlwz6YHJ1xeZKKUAY7aV86FAI4G346Lpz n6BhHdEyF9jegMWMW0rx2FsHAVvi9fkfgw== X-Google-Smtp-Source: ABdhPJy+R/rku41N4BRKD6n1kJ441YDo13ae65/gyGBxBFf9UF3hysySlHekogokeHTTsBOuT8BYRg== X-Received: by 2002:a63:ca10:: with SMTP id n16mr3477869pgi.105.1610050524480; Thu, 07 Jan 2021 12:15:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 18/47] tcg: Make DisasContextBase.tb const Date: Thu, 7 Jan 2021 10:14:19 -1000 Message-Id: <20210107201448.1152301-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210107201448.1152301-1-richard.henderson@linaro.org> References: <20210107201448.1152301-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Joelle van Dyne , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) There is nothing within the translators that ought to be changing the TranslationBlock data, so make it const. This does not actually use the read-only copy of the data structure that exists within the rx region. Reviewed-by: Joelle van Dyne Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- include/exec/gen-icount.h | 4 ++-- include/exec/translator.h | 2 +- include/tcg/tcg-op.h | 2 +- accel/tcg/translator.c | 4 ++-- target/arm/translate-a64.c | 2 +- tcg/tcg-op.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h index 822c43cfd3..aa4b44354a 100644 --- a/include/exec/gen-icount.h +++ b/include/exec/gen-icount.h @@ -32,7 +32,7 @@ static inline void gen_io_end(void) tcg_temp_free_i32(tmp); } =20 -static inline void gen_tb_start(TranslationBlock *tb) +static inline void gen_tb_start(const TranslationBlock *tb) { TCGv_i32 count, imm; =20 @@ -71,7 +71,7 @@ static inline void gen_tb_start(TranslationBlock *tb) tcg_temp_free_i32(count); } =20 -static inline void gen_tb_end(TranslationBlock *tb, int num_insns) +static inline void gen_tb_end(const TranslationBlock *tb, int num_insns) { if (tb_cflags(tb) & CF_USE_ICOUNT) { /* Update the num_insn immediate parameter now that we know diff --git a/include/exec/translator.h b/include/exec/translator.h index 638e1529c5..24232ead41 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -67,7 +67,7 @@ typedef enum DisasJumpType { * Architecture-agnostic disassembly context. */ typedef struct DisasContextBase { - TranslationBlock *tb; + const TranslationBlock *tb; target_ulong pc_first; target_ulong pc_next; DisasJumpType is_jmp; diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index 5b3bdacc39..901b19f32a 100644 --- a/include/tcg/tcg-op.h +++ b/include/tcg/tcg-op.h @@ -805,7 +805,7 @@ static inline void tcg_gen_insn_start(target_ulong pc, = target_ulong a1, * be NULL and @idx should be 0. Otherwise, @tb should be valid and * @idx should be one of the TB_EXIT_ values. */ -void tcg_gen_exit_tb(TranslationBlock *tb, unsigned idx); +void tcg_gen_exit_tb(const TranslationBlock *tb, unsigned idx); =20 /** * tcg_gen_goto_tb() - output goto_tb TCG operation diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index fb1e19c585..a49a794065 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -133,8 +133,8 @@ void translator_loop(const TranslatorOps *ops, DisasCon= textBase *db, } =20 /* The disas_log hook may use these values rather than recompute. */ - db->tb->size =3D db->pc_next - db->pc_first; - db->tb->icount =3D db->num_insns; + tb->size =3D db->pc_next - db->pc_first; + tb->icount =3D db->num_insns; =20 #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 2e3fdfdf6b..ef63edfc68 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -410,7 +410,7 @@ static inline bool use_goto_tb(DisasContext *s, int n, = uint64_t dest) =20 static inline void gen_goto_tb(DisasContext *s, int n, uint64_t dest) { - TranslationBlock *tb; + const TranslationBlock *tb; =20 tb =3D s->base.tb; if (use_goto_tb(s, n, dest)) { diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index af7ce91ffa..19fa8e4691 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -2664,7 +2664,7 @@ void tcg_gen_extr32_i64(TCGv_i64 lo, TCGv_i64 hi, TCG= v_i64 arg) =20 /* QEMU specific operations. */ =20 -void tcg_gen_exit_tb(TranslationBlock *tb, unsigned idx) +void tcg_gen_exit_tb(const TranslationBlock *tb, unsigned idx) { uintptr_t val =3D (uintptr_t)tb + idx; =20 --=20 2.25.1