From patchwork Wed Jul 21 19:59:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 483338 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp6527724jao; Wed, 21 Jul 2021 13:18:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzE49iNT1YE78iv/9YUZuQkuE6oQFYvepELH1SxjauIVM4kDmeCGe6hY+Gu59cCdXS93j7w X-Received: by 2002:a0c:e313:: with SMTP id s19mr37569991qvl.26.1626898681120; Wed, 21 Jul 2021 13:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626898681; cv=none; d=google.com; s=arc-20160816; b=AUWQJDc77JiUcL+fIDMnw4uQmaAPM73ZarZF2SjfrZ9y2qlE8dH4qj79M5Ydl5UzZT dSs10J0YsAguJ3CbxCiNr83wXM52V4Xm0vC96MpaiM4IHpxYUq9bXO5TSqR3nGv2DvQ1 97Vhx4cKJnEB/nwftkaDt5L0fxzu1Q48iRAw9zEBwhWRF+N+wMobq2f8w2lG9MGYBm8s p8OTcnsfXJHxrTvtAurk/GMCnX8rhr74YQgkXU9XHYSVEDRpt9JAGOSQ2ZnHjmyR94E+ VgZ+FQdRnY/Z9DYeJWzLU0vRqEjLF8R8LPLCcwrYrVLDDbPJkUgyXF3RBGbskyGEJ4s3 3vOA== 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=uv4KyE46xKGLObtihhZF89wcjkrGbag40+YXKQhFASw=; b=BXgL3SZg+BMqzsLh+kGH90im2cJ+ycMBlp+54hNNJSGfMT8elHhukBCSPaslXIEcaj Ft9YdLQ/J7DpsTJD1atOMp17FnjpQsIce1D7QxdoGbrivFX7a/e8Z6lJSvwfuVxpt758 wAtMFys84ViWGK8AnH/upiXt8Frv2rLKezfFWViW/qQ8MT26pR6hT/uMyMDyPs4lNrGS J+dexF9nzMFmaG/0QWmJU5PMy/cmmJ/lBGQtObIQ3ZLyNl0nj9Aj89IjUxMZyOcCHb2M 0fFe91lng77o/7j5whyB6vG6vHcS6a3wNwlP9RnZuPleGza5IvOMshBkO7cM1OkZItgU RMuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BIMXz1jc; 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=fail (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 l4si8630488qtv.28.2021.07.21.13.18.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 13:18:01 -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=fail header.i=@linaro.org header.s=google header.b=BIMXz1jc; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6IfI-0008Ic-Gy for patch@linaro.org; Wed, 21 Jul 2021 16:18:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6IOT-00031l-29 for qemu-devel@nongnu.org; Wed, 21 Jul 2021 16:00:38 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:43531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6IOP-00063H-Te for qemu-devel@nongnu.org; Wed, 21 Jul 2021 16:00:36 -0400 Received: by mail-pl1-x634.google.com with SMTP id b12so1632118plh.10 for ; Wed, 21 Jul 2021 13:00: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=uv4KyE46xKGLObtihhZF89wcjkrGbag40+YXKQhFASw=; b=BIMXz1jcOrQdmm20Z+9NcGCm1SFpdh7U9wkW2CnrQqbc78BmY9FG3wBhOEkRhJGgT6 9MjLZB71afSqzl4D8Hufbfq3Av9WV7R7ilWicDrKNJXiJ6cJW5yhSLL45FYq/oO+Sxm3 vwagNiWMLicR4cfg3rHeLido0HKzRi+z1Dx/bbo7SjFCE7Yj5kEz+31fc/EgZRf05Gv4 oh0lMOknlu+0H2DaefTLwnIDLs2F8oNWcHuIRyWlXnRCzwucW7Iz86kHmQVUTopA+Tkt rdAIxHYt4nAtMnN3LjsF9kj5G86pGlZ4lohsLz7SlYBdBoIasmBNmKhv8KsVKEzwphFB O1Dw== 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=uv4KyE46xKGLObtihhZF89wcjkrGbag40+YXKQhFASw=; b=JdxvxI5QPtIycFXDh5sC7Zd1iFzJ71z+SXXnxEQidxMUGFvhMjItSbAsK+OhKHrNhS gB7txJ+Ci/zWON+eS2iQcOU6toPq1jlCYk20CY5T/ePObdzbZQvOgtMato3VeB7HCzou V+4zHKbv7sIToX8Bx09gu3WcDuMzgsLWCCCxzFd6s6BEGAc3sJC5z7JU4jEjHJgg2ZHJ iBUIWVSg69QXuDeAUGh84vHU3sFoIOEQ2A697Hz0WUH0ZUzkKRi/Zo/Oirwyep3kzTJB o/vLmmPYkuSdedBEgAkbNtkHjz5axAmfgpNZwAbRM0tQfi2bc+MFsK8OhD67IcYSDVML Hkpw== X-Gm-Message-State: AOAM533qW8fwo20vbTGsg5HCK/mvj/DUiKOpMLr8xEXCmyTKSEIe+sZ8 c6EzOTkhFuUtoBK52vg2lpOhGK9LpIGJRw== X-Received: by 2002:a17:902:c215:b029:12b:25f7:9b11 with SMTP id 21-20020a170902c215b029012b25f79b11mr28920379pll.82.1626897632527; Wed, 21 Jul 2021 13:00:32 -0700 (PDT) Received: from localhost.localdomain (204-210-126-223.res.spectrum.com. [204.210.126.223]) by smtp.gmail.com with ESMTPSA id w3sm706028pjq.12.2021.07.21.13.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 13:00:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 26/27] accel/tcg: Hoist tb_cflags to a local in translator_loop Date: Wed, 21 Jul 2021 09:59:53 -1000 Message-Id: <20210721195954.879535-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210721195954.879535-1-richard.henderson@linaro.org> References: <20210721195954.879535-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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: =?utf-8?q?Alex_Benn=C3=A9e?= , peter.maydell@linaro.org, Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The access internal to tb_cflags() is atomic. Avoid re-reading it as such for the multiple uses. Tested-by: Mark Cave-Ayland Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/translator.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 4f3728c278..b45337f3ba 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -50,6 +50,7 @@ bool translator_use_goto_tb(DisasContextBase *db, target_ulong dest) void translator_loop(const TranslatorOps *ops, DisasContextBase *db, CPUState *cpu, TranslationBlock *tb, int max_insns) { + uint32_t cflags = tb_cflags(tb); bool plugin_enabled; /* Initialize DisasContext */ @@ -72,8 +73,7 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db, ops->tb_start(db, cpu); tcg_debug_assert(db->is_jmp == DISAS_NEXT); /* no early exit */ - plugin_enabled = plugin_gen_tb_start(cpu, tb, - tb_cflags(db->tb) & CF_MEMI_ONLY); + plugin_enabled = plugin_gen_tb_start(cpu, tb, cflags & CF_MEMI_ONLY); while (true) { db->num_insns++; @@ -88,14 +88,13 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db, update db->pc_next and db->is_jmp to indicate what should be done next -- either exiting this loop or locate the start of the next instruction. */ - if (db->num_insns == db->max_insns - && (tb_cflags(db->tb) & CF_LAST_IO)) { + if (db->num_insns == db->max_insns && (cflags & CF_LAST_IO)) { /* Accept I/O on the last instruction. */ gen_io_start(); ops->translate_insn(db, cpu); } else { /* we should only see CF_MEMI_ONLY for io_recompile */ - tcg_debug_assert(!(tb_cflags(db->tb) & CF_MEMI_ONLY)); + tcg_debug_assert(!(cflags & CF_MEMI_ONLY)); ops->translate_insn(db, cpu); }