From patchwork Fri Oct 19 06:06:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 149219 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2905460lji; Thu, 18 Oct 2018 23:10:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV63L6cXyPcUhu6GvII8fXe7givEF2RI0ed8f14JGpx2YxotaKgT0llKops63jdK7sNp1Squp X-Received: by 2002:aed:2a73:: with SMTP id k48-v6mr32069374qtf.102.1539929408572; Thu, 18 Oct 2018 23:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539929408; cv=none; d=google.com; s=arc-20160816; b=0QPrkush5iBoCdTkprKnQSKSmtbCq+OiTS8RdCJ3C5GJ1Um3sEE4k39cg69JXiZIsM n25EMrOTmng1KdEFPV2wodeqXn7WiF0doQGH3zfdtml+ZPZoCfzGxsQVEedW+/pXXKgJ Mi3X396aRryyBhonWtiZ1+gDmbxca1y94Nz1dmImb+wfSm3oifTLDqgl1HWTzZO2nwhn gun4JuzILPFnhOFkFTEKnZ1aLbIBpaTVP/rNWf9KVx/ATLpHky8I4W8Mnk1NDBRTSpZo JvhISu917+us2O48M02PGJat8yRHQwtf83aS9FuOWMkKFABLTueA98gJTQQyhHs2Mu/3 rDUA== 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=PutIawyEqsVDsuIc6uzk6Km/n+/JX9Tft0106/551uPxYpXJk2sZDU3qP1FjlJwJGY AHycGFVsgOKIV2lgeVVwm3+tiPrxq4hOF5OhClWQ4xjV/VqXoI7w92GeeDa/bfdInPxM 8rDMqXKs7+cifrJRe7NsoWT2wsg8fT9I7L+glf02TbVmmKfSzvB1TMQ1em2PmMOcmHPq TZ4CUFPNJC9eB520TJ956CZF8W/Jiy44/RLMz5UzrxXEhDH/q08iDQXtHd/Gf2JdyzXm gDDJxNR2rTBr912aVUi9jd/qkp3QBT+tzCfkxZ8x2NetMHexcErwWY3E17ktGgrwX8+l Ed6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=K0BBlLlm; 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 l101-v6si3007664qkh.92.2018.10.18.23.10.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 18 Oct 2018 23:10:08 -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=K0BBlLlm; 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]:47224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDNz6-0006nt-0k for patch@linaro.org; Fri, 19 Oct 2018 02:10:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDNw8-0003xQ-BF for qemu-devel@nongnu.org; Fri, 19 Oct 2018 02:07:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDNw5-0001hP-MF for qemu-devel@nongnu.org; Fri, 19 Oct 2018 02:07:04 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:43018) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDNw5-0001er-B8 for qemu-devel@nongnu.org; Fri, 19 Oct 2018 02:07:01 -0400 Received: by mail-pl1-x62a.google.com with SMTP id 30-v6so15380354plb.10 for ; Thu, 18 Oct 2018 23:07:01 -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=K0BBlLlmZ6zlo02qYbbp74EFNVbr91nZXUwOn7sKxTwBONq6yjdMQSmT3D4vG+Zy0p cYG37Zwv0/zLm8SNX+j5vXGTvdeAObvPCe3EaOYuajpgZCoS6wEHNuBAONWZognwqUWT iRw8EGsWwWbyT3sVKTDlQcTGLFKJFRDgivMv0= 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=iI6FxbV03jHgARboRyXLHjcuEyuWRIrkI9Za+K4q16L+9YG8eHvKkDPErFHRN/oCDV bdx3cIrLJHG+RY7lREERs6v1PXHVWiUcnKpjglEEX5toqgsv1HisXMPOGcUfzGBkjNcn wJcUoJVyqOFi86nSbV13TRVe0K1/W6lvmLbPazaqnp2BF5wfe+DLjhMDmeL2NGEa47jt XE+dlzLDT0GwG7aEwywZ047K7b7792VC76eIdLYtDAWrfPdsqZmH/ppfxzrgjdl66Ea+ uF0E4KMnk9POWUJKiCF50gcXw93fAWRiXDeCQv3KvkEl/L3BxnszJkhdxL+tRHvHXNqw 9/cQ== X-Gm-Message-State: ABuFfoh33jGP8nwwFSgyUG+ue4HVtmuXztw248f7cTEiPyohBidNqq0t 5PckA6D/KXQjoxPKDUQ7VLHnEXI1k7s= X-Received: by 2002:a17:902:d881:: with SMTP id b1-v6mr33462873plz.10.1539929219987; Thu, 18 Oct 2018 23:06:59 -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 q24-v6sm25609327pff.83.2018.10.18.23.06.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Oct 2018 23:06:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 18 Oct 2018 23:06:36 -0700 Message-Id: <20181019060656.7968-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181019060656.7968-1-richard.henderson@linaro.org> References: <20181019060656.7968-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::62a Subject: [Qemu-devel] [PULL v2 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)