From nobody Tue Feb 10 12:59:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1598891456; cv=none; d=zohomail.com; s=zohoarc; b=OQl6b/ltolODPzUolmq8amSUraMqnaKXHjmETLWg6y7c6hHqKV/4EpZ3ihdVe8dH/9GnL4VeUK+BtJv3xpdS4W2NUzlGdv1IhD5mOkWhvW5KQbnk7kKTDiD6X+OEdB1jYxqQf9s8vBdIp/0eYTsWc0ENz0WCtvfHEugQUT+LefQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598891456; h=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=pM4ivWigF6aGuCdn4jvlwQnVJrMGcBGI733lqrG0wt8=; b=WfG3vXThZDazfoHIHYLtPaRjACfofViTitFGS7COgoBLOvYL4gDchOoz6PKJbkkOC5oA/Jv3R6bKJ0qnPbv14oxgDZ/57cph4go2J1usYOhVqQpAm+dNrANsL8sXa8VxdDkBIWyiQ9XGDDWILsjDdfkYS5tJFx0tU646tAQ9upw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1598891456377807.0467145154017; Mon, 31 Aug 2020 09:30:56 -0700 (PDT) Received: from localhost ([::1]:38732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCmhr-000538-Dm for importer@patchew.org; Mon, 31 Aug 2020 12:30:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCmKy-0005nh-GY for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:07:16 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:46350) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCmKw-00065v-Mn for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:07:16 -0400 Received: by mail-pg1-x531.google.com with SMTP id 31so821100pgy.13 for ; Mon, 31 Aug 2020 09:07:14 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id gt13sm17218pjb.43.2020.08.31.09.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 09:07:12 -0700 (PDT) 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=pM4ivWigF6aGuCdn4jvlwQnVJrMGcBGI733lqrG0wt8=; b=eo0V4/VtOHM1WLUX8u1mPPtH4HcbQbO93GYkPjuc14JcxAKyPyGhWEnWE6Jg8m2lCe hzucK6vnsoY4UvHNCz0OBNTzuhqu3aUdAizlGcMdLUXHjsAcTv9ooOw6oZu6/WsR4DW5 VLQ02C6BdUvf2Mr0vF+6xkhouKPOpTAA3iIZ23gjJs2+vFg1kYGbyqNWwAGgisH8YT7H 94leYBUkLp96J/PfpmL9iy5YQTAtTwELumMYYrsXiDHItoiUp+49+kedSr6Pworb+A4T NvnhH2x6I+H3HGabPGsAWDm3fmJQ1Y4IqLQf0h78ztsrZQcUxlZWVtVPErBNjf6c5NtV oZ2g== 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=pM4ivWigF6aGuCdn4jvlwQnVJrMGcBGI733lqrG0wt8=; b=PNOgTakZbNg4Ay2cGrpSdZ/+e9CTrvraCjJ3yAk2ts9Hdhy+mna92Aw9TsQ0tEE+d6 X38OK6sCD7mMxudwmY4c5fq46yKz180p/qPAnZwvp7ZVNuhReDfUfSWxfhr5KNSis4cs zWxRu5BYCh9YTlygmtF6jIjPmTm1QnismhFK626Hc1PKTnKyb0zcOaFjOMRFMIBNSuvs i/GDlVoqkuHZwXH/xakRvAkPDXTGoUjM17nA0svzYuCrgWj27nwvrdAFeqWcbKtvLs5A Y/kRRHJ8rQpTWpflrca+z/TtBPM+EbhzbQ7WzpvUMq/z/RY1mI4ynhKBovqW01/ziOsj YEuA== X-Gm-Message-State: AOAM533EUwCC320kXcSeOhZsuHGrdnKwxdjsPZ9KcZRZeIEIQZdszT4D HPv7kdcLmoashw8mCDAs0jaTynZxvmoXbg== X-Google-Smtp-Source: ABdhPJySy/52fa/mjP+R9XffyDmGbouX92CKqdSdx84pqgjMFx5A8jV09hupKEwCZEE8nTeQ+3rFfA== X-Received: by 2002:a62:406:: with SMTP id 6mr1762033pfe.193.1598890032881; Mon, 31 Aug 2020 09:07:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 51/76] target/microblaze: Cache mem_index in DisasContext Date: Mon, 31 Aug 2020 09:05:36 -0700 Message-Id: <20200831160601.833692-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200831160601.833692-1-richard.henderson@linaro.org> References: <20200831160601.833692-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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: "Edgar E . Iglesias" , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Ideally, nothing outside the top-level of translation even has access to env. Cache the value in init_disas_context. Tested-by: Edgar E. Iglesias Reviewed-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 1f6731e0af..a55e110171 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -73,6 +73,7 @@ typedef struct DisasContext { unsigned int delayed_branch; unsigned int tb_flags, synced_flags; /* tb dependent flags. */ unsigned int clear_imm; + int mem_index; =20 #define JMP_NOJMP 0 #define JMP_DIRECT 1 @@ -175,8 +176,7 @@ static bool trap_illegal(DisasContext *dc, bool cond) */ static bool trap_userspace(DisasContext *dc, bool cond) { - int mem_index =3D cpu_mmu_index(&dc->cpu->env, false); - bool cond_user =3D cond && mem_index =3D=3D MMU_USER_IDX; + bool cond_user =3D cond && dc->mem_index =3D=3D MMU_USER_IDX; =20 if (cond_user && (dc->tb_flags & MSR_EE)) { gen_raise_hw_excp(dc, ESR_EC_PRIVINSN); @@ -968,7 +968,7 @@ static void dec_load(DisasContext *dc) TCGv addr; unsigned int size; bool rev =3D false, ex =3D false, ea =3D false; - int mem_index =3D cpu_mmu_index(&dc->cpu->env, false); + int mem_index =3D dc->mem_index; MemOp mop; =20 mop =3D dc->opcode & 3; @@ -1077,7 +1077,7 @@ static void dec_store(DisasContext *dc) TCGLabel *swx_skip =3D NULL; unsigned int size; bool rev =3D false, ex =3D false, ea =3D false; - int mem_index =3D cpu_mmu_index(&dc->cpu->env, false); + int mem_index =3D dc->mem_index; MemOp mop; =20 mop =3D dc->opcode & 3; @@ -1540,6 +1540,7 @@ static void mb_tr_init_disas_context(DisasContextBase= *dcb, CPUState *cs) dc->ext_imm =3D dc->base.tb->cs_base; dc->r0 =3D NULL; dc->r0_set =3D false; + dc->mem_index =3D cpu_mmu_index(&cpu->env, false); =20 bound =3D -(dc->base.pc_first | TARGET_PAGE_MASK) / 4; dc->base.max_insns =3D MIN(dc->base.max_insns, bound); --=20 2.25.1