From patchwork Tue Oct 16 17:48:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 10644083 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F245913B0 for ; Tue, 16 Oct 2018 18:23:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E290A28F96 for ; Tue, 16 Oct 2018 18:23:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFCE32909C; Tue, 16 Oct 2018 18:23:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 79AE928F96 for ; Tue, 16 Oct 2018 18:23:19 +0000 (UTC) Received: from localhost ([::1]:59583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCTzy-0002LV-Nn for patchwork-qemu-devel@patchwork.kernel.org; Tue, 16 Oct 2018 14:23:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCTTP-00046a-78 for qemu-devel@nongnu.org; Tue, 16 Oct 2018 13:49:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCTTL-00010P-1a for qemu-devel@nongnu.org; Tue, 16 Oct 2018 13:49:38 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:41139) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCTTK-0000eD-KW for qemu-devel@nongnu.org; Tue, 16 Oct 2018 13:49:34 -0400 Received: by mail-pf1-x42c.google.com with SMTP id m77-v6so11818904pfi.8 for ; Tue, 16 Oct 2018 10:49:16 -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; bh=v87Nv8KtOwBwH1Vf6pnmPV08acciS7b2jzoCLS0sc10=; b=GqN2EAokRKp+BnHs4uXJQaCIXM0RiwVaJQcM9H692MdmkINxpMR38aRsxc9neifpFk x3Dob6MF54oHiVHwW6uC/ynho4TigCSapPic4ayfY2A1omP1oBeG4VXb60j0fYD+syAA 2wYKryKBywUWe4qG7L5y94WkMC2f/LFtBXM6M= 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; bh=v87Nv8KtOwBwH1Vf6pnmPV08acciS7b2jzoCLS0sc10=; b=eZJH/RxPdAg8pLabZg1uvWkJW1rkNv+iqJ/eAWVF+UdEj/laUI1iXNb7dPUEVXMjk8 CPzPOUkNnSHYWPNxa6aFRmtK361lZzjVC3AgrmrTVUrUcQMaz/UpAUVM6j5vCONVv2ws T6hYbKwd/GH0SDZX9lWIJPvat7Lf77cIG62TB/L4J2ZaHbcV6q908EFr4wW9GcHt5lV4 Gz7+behJ9+HnLzgi88isscd8RcBcxi7ytntM0zV8FXHRyFmYo1IMGwOQNbO0iacsmXxj Wq1FaFsWMxdYAgtllZmcklkj6cZ5G/iMTnodL+oOYs06A95Jd8VzhY2S3QzDiYtlNkOk eANA== X-Gm-Message-State: ABuFfoi9yxvB8usXhy2Wdk1zbe9RrjoJndSI9yK2Tanq/8YBEiVNg5Ux uVsxXcRRcIFbG8dqe8NiEqLorJQxvKM= X-Google-Smtp-Source: ACcGV62vv/nbXziGOTMIoxm1cTZRmT9+Cw4YreNGebrk2l9ieqJDWzlAwmapiRfjRQLxyjRUnJd22Q== X-Received: by 2002:a63:b518:: with SMTP id y24-v6mr21252670pge.436.1539712155213; Tue, 16 Oct 2018 10:49:15 -0700 (PDT) Received: from cloudburst.twiddle.net (174-21-9-133.tukw.qwest.net. [174.21.9.133]) by smtp.gmail.com with ESMTPSA id 6-v6sm17441210pgl.6.2018.10.16.10.49.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Oct 2018 10:49:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 16 Oct 2018 10:48:51 -0700 Message-Id: <20181016174911.9052-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181016174911.9052-1-richard.henderson@linaro.org> References: <20181016174911.9052-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42c Subject: [Qemu-devel] [PULL 01/21] tcg: Implement CPU_LOG_TB_NOCHAIN during expansion 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 Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Rather than test NOCHAIN before linking, do not emit the goto_tb opcode at all. We already do this for goto_ptr. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 2 +- tcg/tcg-op.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 6bcb6d99bd..870027d435 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -416,7 +416,7 @@ static inline TranslationBlock *tb_find(CPUState *cpu, } #endif /* See if we can patch the calling TB. */ - if (last_tb && !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { + if (last_tb) { tb_add_jump(last_tb, tb_exit, tb); } return tb; diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index daa416a143..7a8015c5a9 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -2586,6 +2586,10 @@ void tcg_gen_exit_tb(TranslationBlock *tb, unsigned idx) seen this numbered exit before, via tcg_gen_goto_tb. */ tcg_debug_assert(tcg_ctx->goto_tb_issue_mask & (1 << idx)); #endif + /* When not chaining, exit without indicating a link. */ + if (qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { + val = 0; + } } else { /* This is an exit via the exitreq label. */ tcg_debug_assert(idx == TB_EXIT_REQUESTED); @@ -2603,7 +2607,10 @@ void tcg_gen_goto_tb(unsigned idx) tcg_debug_assert((tcg_ctx->goto_tb_issue_mask & (1 << idx)) == 0); tcg_ctx->goto_tb_issue_mask |= 1 << idx; #endif - tcg_gen_op1i(INDEX_op_goto_tb, idx); + /* When not chaining, we simply fall through to the "fallback" exit. */ + if (!qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { + tcg_gen_op1i(INDEX_op_goto_tb, idx); + } } void tcg_gen_lookup_and_goto_ptr(void)