From patchwork Mon Jun 21 01:34:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464483 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp2117851jao; Sun, 20 Jun 2021 18:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySkG/2kbk8P/+mKe9/bnMW88Lyb1zxDn7KLH9DVTGX275h7PnJ4WKHPLXiAbaeYhz99waq X-Received: by 2002:ac8:505a:: with SMTP id h26mr21775626qtm.225.1624240084038; Sun, 20 Jun 2021 18:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624240084; cv=none; d=google.com; s=arc-20160816; b=nweX1IXA2VVnry9Y49FAwsp95dYooRtuIWl5+EiIyMtlRNG1Idp9GIORlJWq42BWNI Mpf3yL1U88zJKbNL5DJYQ7hjslt4cGPdIaExozD0jzfiHqZ6wpMj5tw+TIN5rC29h7hW a6Pj4TDA+e5a1wEo8prNUgF8pzxJcYtV5p2cikByup+p+5JPomApkKU3nJwif9VXu4sG HRHFs42R8ue+sqk6O+BeQ+E6i9Xq8h+TMIbOAop8ZQIgJ7j61zUgiKLK5lRxLq+pc/5j K41yNVhER+NGtgQO8BE9JOknYJyPkNPvhCHXXWtM8OiUH2L2BeZ2lTN2ED6i5OCzR2hx 8OmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=O6AUcaQKGYp2fnjEQWNm+lyORkEWoJzEefRINwnH5dY=; b=toExmkfIpHFXFdiTP2lJY2gEtY6BTHA/QXtbWh9aGITJfi3ya5Ae6eXKVCi0UeSgAk DvPPATOvZTFCNdmJIjU2OIpz6kceZwuYu4ngasdRJnBsx9NRIp39Td/HHxg8c5mZAWgE a6nvKb0Mz04NzA3aVrfkEEw5U4CbExDf8m9PdOBQ49v4u8gHsldPtDdZBT99kQYY2oL2 zthJYKax/Hptx6NKKWslQ4JU37WcJseqfvILWFt2XFAZ8sDuii3OipreBUA0wlN5/eWx dv/ddwSHZDJ3dfmdUBigXETplGSHuVAKueyUCcY1/XKaUJkbmhF8uNdoG7rXBg5yePT2 inwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u3xxZLSc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 8si15318803qtr.394.2021.06.20.18.48.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 18:48:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u3xxZLSc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv92h-0004fV-Ea for patch@linaro.org; Sun, 20 Jun 2021 21:48:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv8qD-00045B-DI for qemu-devel@nongnu.org; Sun, 20 Jun 2021 21:35:09 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:38604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv8pw-0005Dj-Iz for qemu-devel@nongnu.org; Sun, 20 Jun 2021 21:35:09 -0400 Received: by mail-pg1-x529.google.com with SMTP id h4so1303296pgp.5 for ; Sun, 20 Jun 2021 18:34:52 -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=O6AUcaQKGYp2fnjEQWNm+lyORkEWoJzEefRINwnH5dY=; b=u3xxZLScRlSx0Ro0I4YZJHaWX2MDKXN2uW7NENwfTZJofE1oDD1iwRRdEtsMD/5F6K aynU7r+1RTs63pw7s6vnwzvhRQYlijyW+x3clSgpHWzM14py2b5Sdly7She0wgnCVH1C O6Tt6dD0ajTcgPi9DKrTlpNoI8Fgo43VnPOpMZXEDw7mghtBe1iV1rO2aoU9AZl3Us2R 4BZkJaxLYAvvkTOx3B3ZV5qkuWpQaAi56ExDZmbdZxnkybQQ/CzCgqDWKrUVmCMRkIXl 1SiptWZp5IuGOPSiXHPz+M0JdCEn87lilNgrRWJRiDvrNrcCd7KJoy+NduzN+EQo+Uq1 6mmA== 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=O6AUcaQKGYp2fnjEQWNm+lyORkEWoJzEefRINwnH5dY=; b=ENO6BHVqCpJmTHEqlxn2SfMPdnGlBrO6+xiTnQEv3bh8qNEu6hav+CcjJ8O+La9ZQU Xhkv2PvB0IbJiSXwNaci3aYQOoCsE8z5Ri5xgLNneioQI5/XYuRcwUc35p/3809WG/fJ nNtUqHCuhtun5wmh6MuekhRtL3bpzA4QYEzPwVgjMOfHGXE3yMhjB93t/hAPP2+Tr47Q Mtai/+Okh7W3ZoLFVwjJcLCDdKqkNk2wWsFTGC3SwS6jMcQ2v+87OMDRi3n94nIo+n0/ iS3aKFp4D5XYMDSFiFV2e1T3tbQI09N+06eKW+hEFpucOV4Jo2NdoX5Iq1EcWlUm3OMt Z36Q== X-Gm-Message-State: AOAM5324BOQGItk/1VJnbgQT+qyvG0dGlDemd0/LrTa4Ohv9iV72jEv1 mYeU870/5dC7TrpnMMqlp0ibs8wL5k69gg== X-Received: by 2002:a63:ff20:: with SMTP id k32mr21772363pgi.82.1624239291358; Sun, 20 Jun 2021 18:34:51 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id s27sm1495628pfg.169.2021.06.20.18.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 18:34:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 18/26] target/riscv: Use translator_use_goto_tb Date: Sun, 20 Jun 2021 18:34:31 -0700 Message-Id: <20210621013439.1791385-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210621013439.1791385-1-richard.henderson@linaro.org> References: <20210621013439.1791385-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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=unavailable 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: qemu-riscv@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Just use translator_use_goto_tb directly at the one call site, rather than maintaining a local wrapper. Cc: qemu-riscv@nongnu.org Signed-off-by: Richard Henderson --- target/riscv/translate.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) -- 2.25.1 Reviewed-by: Alistair Francis diff --git a/target/riscv/translate.c b/target/riscv/translate.c index c6e8739614..ecd3764338 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -168,29 +168,11 @@ static void gen_exception_inst_addr_mis(DisasContext *ctx) generate_exception_mtval(ctx, RISCV_EXCP_INST_ADDR_MIS); } -static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest) -{ - if (unlikely(ctx->base.singlestep_enabled)) { - return false; - } - -#ifndef CONFIG_USER_ONLY - return (ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); -#else - return true; -#endif -} - static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) { - if (use_goto_tb(ctx, dest)) { - /* chaining is only allowed when the jump is to the same page */ + if (translator_use_goto_tb(&ctx->base, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_tl(cpu_pc, dest); - - /* No need to check for single stepping here as use_goto_tb() will - * return false in case of single stepping. - */ tcg_gen_exit_tb(ctx->base.tb, n); } else { tcg_gen_movi_tl(cpu_pc, dest);