From patchwork Wed Jun 30 18:32:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 468714 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp607886jao; Wed, 30 Jun 2021 11:34:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJi6m4JDhg36bN+fp+kWqBGOIw26fm8pMyn5pdVX97jrr/8RBsqlE5+LvuogjPX4OcBq6K X-Received: by 2002:a5b:50e:: with SMTP id o14mr46236275ybp.43.1625078053359; Wed, 30 Jun 2021 11:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625078053; cv=none; d=google.com; s=arc-20160816; b=qLj4wK76DCanWddWDTXAxd6vAfjjpwLSyfRoHrWIpFlB8pheNOLUlWmsa2weFiHsid WmrBsOXc9k6EDJC1raLdcEJ1X44wONAhVTf1M+e3C4pPAeVM7NciE0fy9DZIZrTwzFVY OktLbLZPyXyn1LbRUVCHXi7TNrGrn29wwHsPzOHdJPdiNzpo3T/nDijTYEBO00ICeJj4 BTUXHDIxnc7XhFqqkIhsMdrKGxk6DAzj9YtO1+5AkaatwuZNm3HW6FE3Lt+ymo0WiR63 XridwEHzbITYl0WvqnO387l2EoQgtej2MxpAgh+Z1Siz10aZ8u9aqDNBgI/E6s+uA9T+ tNew== 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=8W3E8oUQSB677QQyABV7B4p2F0hPm4epmS7TTIJ96Bk=; b=k+GPTsDu8NdBAy/kqmmWmd98OXf24UfGig9GaF36Yer/+m4lfKhy5VG5KyShV45upW tXqgx6dHvOzxBNiWZVLxEKAcF4ollUGIRoMh8AET9fxUJjRDoCdFa2r0aQjOKO5o8Ath Ipo2LyvHYvT5Ft+W6qeNZNPtia1tiJsmqyRJw46vqTduK9ZtT7WmRWzeFEduh5aDrYVa U3mzI+Jz9FUZl0XeGmTQZcrt+BfTz5J1eRyXaIGHa27L7aipBwQVg9JNoc+WuiyfsEGC iSWbU5tyNQ3pitPTBF+KHED6QGf3QVjp0bc/Xnsd44XSTaZbekbHGUsDQ71VHhk1d54T rm9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SlOIausg; 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 k82si8620669ybf.21.2021.06.30.11.34.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Jun 2021 11:34:13 -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=SlOIausg; 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]:36946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyf2K-0005P0-Q9 for patch@linaro.org; Wed, 30 Jun 2021 14:34:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyf0n-0005Bv-QC for qemu-devel@nongnu.org; Wed, 30 Jun 2021 14:32:37 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:34372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyf0j-00020j-Sn for qemu-devel@nongnu.org; Wed, 30 Jun 2021 14:32:37 -0400 Received: by mail-pf1-x42b.google.com with SMTP id i6so3343071pfq.1 for ; Wed, 30 Jun 2021 11:32:33 -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=8W3E8oUQSB677QQyABV7B4p2F0hPm4epmS7TTIJ96Bk=; b=SlOIausg4Hz3hJmCWvLEkzRhqbskKyU7TpFEFXCuLEtxGbF90YnW306n14zNBG2GM0 tT1EBK9KsRvRZZtvIv01L6ZBLVW4o10OdTfSxAaCCcCKIVimWqcPHC7XQThhtBI+LzO3 g3g4s2bKn7vAEG1yr4UKcy/7Lzol+9HZd7E4hLfuw+RzJy9Mhfcshxv9Urp0ThsA4guR CAJZqVmTblshVILHQfPhzdFQP0fRNQTCTjE3tzpKcWvyQBaMMzf7C7D9vZkGmgpboMvu IJ/S8a80UpMxUNsIbAAGPdxSeywR1mPBdlFtbsxL36OyB0Mgk8oGENBK+IaJOujwBvN8 XPcw== 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=8W3E8oUQSB677QQyABV7B4p2F0hPm4epmS7TTIJ96Bk=; b=jmjf6pL89Gll81Z7pogI/+e//JXIwUpn6ZFWVMmbxhc6GIGW8H0pzxBOxJNaVX4dn1 zko3qNis0VGYMhR9fitSt1+G59h0Y5Qz+ElNCNidhZktHq4q+8WzgiUAFmHsxQf/4A+4 zvfo6KEpGMO1DOorT2U5d5JWMhfQ3RCTSz4Ooo6zhFfZVPKYXILY55BEFScb30w4RUWO j61JngiBMk6gWGVtMbOEj2N+BghFpxt6RGSGr/U6Re9PjohstPFTFqzHOL9I7OfXL1bC dnA419OiCEX0Ldn50aFxoVGmmhZJFJNbLXEhuAWNHWc2q60Z18GHiXKEX/+m7vJtDNg8 vXPw== X-Gm-Message-State: AOAM531oBjeHMGIgWVGXAxXhaiOFsbml8X/mkhuTuZSLcgc7BWhnhDXa zIqDWVSHGj113SLJMUzOE5gXcTDSvR0Ihw== X-Received: by 2002:a62:1d84:0:b029:304:5af1:65f6 with SMTP id d126-20020a621d840000b02903045af165f6mr35035355pfd.80.1625077952590; Wed, 30 Jun 2021 11:32:32 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id m18sm23909517pff.88.2021.06.30.11.32.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 11:32:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 08/28] target/avr: Use translator_use_goto_tb Date: Wed, 30 Jun 2021 11:32:06 -0700 Message-Id: <20210630183226.3290849-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210630183226.3290849-1-richard.henderson@linaro.org> References: <20210630183226.3290849-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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: Michael Rolnik Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Single stepping is not the only reason not to use goto_tb. If goto_tb is disallowed, and single-stepping is not enabled, then use tcg_gen_lookup_and_goto_tb to indirectly chain. Cc: Michael Rolnik Signed-off-by: Richard Henderson --- target/avr/translate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/avr/translate.c b/target/avr/translate.c index c06ce45bc7..8237a03c23 100644 --- a/target/avr/translate.c +++ b/target/avr/translate.c @@ -1083,14 +1083,17 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) { const TranslationBlock *tb = ctx->base.tb; - if (!ctx->base.singlestep_enabled) { + if (translator_use_goto_tb(&ctx->base, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_i32(cpu_pc, dest); tcg_gen_exit_tb(tb, n); } else { tcg_gen_movi_i32(cpu_pc, dest); - gen_helper_debug(cpu_env); - tcg_gen_exit_tb(NULL, 0); + if (ctx->base.singlestep_enabled) { + gen_helper_debug(cpu_env); + } else { + tcg_gen_lookup_and_goto_ptr(); + } } ctx->base.is_jmp = DISAS_NORETURN; }