From nobody Wed Apr 2 07:46:33 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626104551218663.0801427155892; Mon, 12 Jul 2021 08:42:31 -0700 (PDT) Received: from localhost ([::1]:36054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2y4j-0006mY-Nk for importer@patchew.org; Mon, 12 Jul 2021 11:42:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2y2d-0003zg-Ve for qemu-devel@nongnu.org; Mon, 12 Jul 2021 11:40:23 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:39567) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2y2V-0000vi-0l for qemu-devel@nongnu.org; Mon, 12 Jul 2021 11:40:14 -0400 Received: by mail-pl1-x62b.google.com with SMTP id h1so9405944plf.6 for ; Mon, 12 Jul 2021 08:40:10 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b33sm18247635pgb.92.2021.07.12.08.40.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 08:40:09 -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=XZ18+TbN3l0IvM4lcz8To1nUnlGMGwhY3IWR1y85/oQ=; b=gI6xTTdnbo+dVvl890e3D1fB75Er7s3Y9ef+qEIB1HhVEAfhMqqIKNmOC051ZQ7kDh YYraKEY6edBRoF8atXLg42hzlFsOmLMhJiFeMbuVLzQ+rfcK/kCObuuhaH6t5nxuV5+Z VOjjp5X3iAqHPwNOge2CJL88BIMbmIrGCt0E+PTKmWLRcbAX8mgvq065U7l1v7QhhOqE 5NFES8AyXAiw+gtyPic4Baozvl0JsJJtb9xh6BQts1lenfU5uzf6q+/ulo25RKXgIcuK 6o1PAfg9w286WMF7WZGRCrZV6d/W66WU1cUXqoh+PNwXfCN+FN04wQYGMLHKcbuJgtue mE8A== 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=XZ18+TbN3l0IvM4lcz8To1nUnlGMGwhY3IWR1y85/oQ=; b=uQjOGo6qw566X2fO+2LGG+/Zvi96A1akMMNkLfwjanRW2SUDZrcfHxplGj4zbtoXDf DQOMl8KA4XtIslU/pDnwm+jB1bdpV8d5EHwYvnTxjGwkskH6pDpmxA3tAzTMnSB8lQnh S2sAQjtYHm2dK3adV5+9uaARFlcnn5N4lrAJDFwhfrzJrhOa8UXT8VII/k7hTkeCYiwj Ovf7NKfyHRdYBEK8/bVtuhfoC6fZkrzXtRhyl5N18rVhUsDYQDyoTcta2V9tvmcGDq/b lDNXJr28gS9Rrq16gekyWrp9fX1UIc7qDS+OXx6aLETAfHcIg/PTNc5Df+It9X2oZXDM eLbQ== X-Gm-Message-State: AOAM5301ZG/OyukaonJyQwdUTlacFCJMBibOx7rDP1myCKGdBbLCPZwC v7SDIY0jtmqIkntY7AQq1SsAuhs4tzvIMA== X-Google-Smtp-Source: ABdhPJzlIwcESTdLMrsDegvt1h+A9OxIaBabWXg6U+HehjhOskaH96U3a4sO9frHxiG9qrUqDhsyvA== X-Received: by 2002:a17:90a:bd94:: with SMTP id z20mr10211718pjr.214.1626104409474; Mon, 12 Jul 2021 08:40:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 07/10] accel/tcg: Move cflags lookup into tb_find Date: Mon, 12 Jul 2021 08:40:01 -0700 Message-Id: <20210712154004.1410832-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712154004.1410832-1-richard.henderson@linaro.org> References: <20210712154004.1410832-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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: mark.cave-ayland@ilande.co.uk, alex.bennee@linaro.org, f4bug@amsat.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626104630712100001 Content-Type: text/plain; charset="utf-8" We will shortly require the guest pc for computing cflags, so move the choice just after cpu_get_tb_cpu_state. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- accel/tcg/cpu-exec.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 5bb099174f..4d043a11aa 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -502,15 +502,29 @@ static inline void tb_add_jump(TranslationBlock *tb, = int n, =20 static inline TranslationBlock *tb_find(CPUState *cpu, TranslationBlock *last_tb, - int tb_exit, uint32_t cflags) + int tb_exit) { CPUArchState *env =3D (CPUArchState *)cpu->env_ptr; TranslationBlock *tb; target_ulong cs_base, pc; - uint32_t flags; + uint32_t flags, cflags; =20 cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags); =20 + /* + * When requested, use an exact setting for cflags for the next + * execution. This is used for icount, precise smc, and stop- + * after-access watchpoints. Since this request should never + * have CF_INVALID set, -1 is a convenient invalid value that + * does not require tcg headers for cpu_common_reset. + */ + cflags =3D cpu->cflags_next_tb; + if (cflags =3D=3D -1) { + cflags =3D curr_cflags(cpu); + } else { + cpu->cflags_next_tb =3D -1; + } + tb =3D tb_lookup(cpu, pc, cs_base, flags, cflags); if (tb =3D=3D NULL) { mmap_lock(); @@ -868,21 +882,7 @@ int cpu_exec(CPUState *cpu) int tb_exit =3D 0; =20 while (!cpu_handle_interrupt(cpu, &last_tb)) { - uint32_t cflags =3D cpu->cflags_next_tb; - TranslationBlock *tb; - - /* When requested, use an exact setting for cflags for the next - execution. This is used for icount, precise smc, and stop- - after-access watchpoints. Since this request should never - have CF_INVALID set, -1 is a convenient invalid value that - does not require tcg headers for cpu_common_reset. */ - if (cflags =3D=3D -1) { - cflags =3D curr_cflags(cpu); - } else { - cpu->cflags_next_tb =3D -1; - } - - tb =3D tb_find(cpu, last_tb, tb_exit, cflags); + TranslationBlock *tb =3D tb_find(cpu, last_tb, tb_exit); cpu_loop_exec_tb(cpu, tb, &last_tb, &tb_exit); /* Try to align the host and virtual clocks if the guest is in advance */ --=20 2.25.1