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: 148985 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp5439044lji; Tue, 16 Oct 2018 11:24:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV618Tlzs9jy/SQGogp8+NEZVRfr4JPl86MvPk+6oF5LyGp+D9bRzW5QC3DFNSLaDTy+UmNV9 X-Received: by 2002:a37:8305:: with SMTP id f5-v6mr21673313qkd.230.1539714282941; Tue, 16 Oct 2018 11:24:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539714282; cv=none; d=google.com; s=arc-20160816; b=0kQVVEKzhX0PVgilf8Ye21iYqrnggTvD5qklkb96yeXX3IWjAHKDkTwMgHkst+R2i7 DJR/0W8xf3Ir6rNF0ApGqmgKUoH9vM0/5dzUPYwhLYp+cfBJKDPyLeExhpW0okgtypkF jkRk+s+/SA/KGbTAwmsmsIR/YF2tZx/nV/R9hyA+/9k0ch9nvYqG6p59xrWzMBHuwR1Y qoZMtYIouhfqKyoSGcuTnQKPbwEDSZeuf0T0rnCUXaRuL2YNFTc4HV4YQkXUCUwc7/Z8 PZDMhkh08cu28S94rsiN5oDCbFVjZATsUnsdZ7kUPLSDUluHMIWQ8I2TTtpq1P+hWamW Gh6g== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=v87Nv8KtOwBwH1Vf6pnmPV08acciS7b2jzoCLS0sc10=; b=qKpBp+W0F85AwIqdACcuhdiabF9Fpny5dxYm6XbNhJjkzxkjFiuRw44AEYPJM3VjAE EZuHmfusN7ceU5yaOLNQxemFBzTWK7NKuJtLeR+ibGkonghnF/xc30ewURKh9tfDJFMN d+98MwvEYL7DANUJZEBOZumUj3djorceBTfPRezhEbhSMf2WpFqV1ayyTeG+nMJE8Kby MKnxzb0/R6inbPhDB1kW9vzNdx9nWlR7hCLoXurb11pJTY19ORfJn7ufbKBb7nJm0q6e UrJsAnhM5BmoJG49my33KHaU+pqo/K8iofpWT+GSdDjM+oLUwHki1tA70w5NhTJXT9Iv FK9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GqN2EAok; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f72-v6si3329351qka.50.2018.10.16.11.24.42 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 16 Oct 2018 11:24:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GqN2EAok; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCU1K-0003U5-BM for patch@linaro.org; Tue, 16 Oct 2018 14:24:42 -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-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.17.2 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)