From patchwork Thu Jul 1 15:25:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 469108 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp502437jao; Thu, 1 Jul 2021 08:34:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0cyJK7Z7FikE+A39hZXWu6IlqfoZPe0sw41vl493knq6OKm3iE+VmbVsg2b9ytwkgX2g0 X-Received: by 2002:a17:907:d9f:: with SMTP id go31mr445290ejc.165.1625153645511; Thu, 01 Jul 2021 08:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625153645; cv=none; d=google.com; s=arc-20160816; b=Bzr+d6EVPojcWFf38KrnBcqd+hYr/bDwyOtWMgDXZPbNLFmr4aVYctUQzWPKlPB8tV Z7lQCasIJql1HJrFS3oF+VrEnelOHrN+94aeXbj/cC47AHpDPvxiVh60Db5QPABc39F6 jvl3n4n5zkrmyHFb8z7NW8WgAoNX2Fw/YM9tIJwxsMT/hcPkKR6sVAURYdAXxh8fu1U7 oYJsKrB1CIk2VdxVcYiSisXlWXXOWiE/b50Ya96HRnD2nGh5vWJ01CJ/n1vxunf+merU aa8aOz/d6Fv/muuUvVmeRqV/FcZCzq0ZhZ0zJjSGp6Lq8S6Fb4Hf7lx+Kj7qtWprkC3T bmqw== 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=Ml7uB0OtQwcxX5TZhhBtWO2veCNQTvvwJhhIq0gQl44=; b=p/SLOeU+6WvdFXoi3QA9XeQwnAluGYNHfbmzkYdlXr6RLJ13yC8LqK1GSP8zyxsEIo cAKuvggoCYIW/0R2vHqziNST+10ZxdDF7fPnRyWx/djG5oKpqEDNtTiszMb/3XlSq15X kfMmOhweJpar7PY9xg3hCqGQodsrrGNbzsKxqm+hpmOIzAd5OOAb/8FA6rPCZS193KZo /I1uBs6epWZ9zF0XGCQiwk7qI9YAJHJWCjYDrB+IdQaSJLPCrVHr9IbGNqJoTxMScQ4H hS/crP0Da1cqH0u7NVUnIuemcuNaZcFHDvq3yzhB0t7oIbKkFRFeObPnoGsxI+S3SM/H rJmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=i1cgegt7; 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 jy12si291971ejc.519.2021.07.01.08.34.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Jul 2021 08:34:05 -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=i1cgegt7; 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]:58400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyyhY-00047d-IJ for patch@linaro.org; Thu, 01 Jul 2021 11:34:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyyZj-0004dC-PA for qemu-devel@nongnu.org; Thu, 01 Jul 2021 11:25:59 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:43773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyyZX-0008FY-Od for qemu-devel@nongnu.org; Thu, 01 Jul 2021 11:25:59 -0400 Received: by mail-pg1-x52f.google.com with SMTP id o18so5784662pgu.10 for ; Thu, 01 Jul 2021 08:25:46 -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=Ml7uB0OtQwcxX5TZhhBtWO2veCNQTvvwJhhIq0gQl44=; b=i1cgegt7gkgPQ7KB4t5PbQCp2cztGtdmmUfl1Bn5m9ArVgu87g2+IfHsF3J+e3LHAH MHtaJGUaL4COmZXZAsrHCIoYHXHQidSboKxMUR/nPzBBECqJKQBPdV8FxEOEzIMyzOPf nDbD06XHUmp9xNTgwuqwtkJdNKSKn91QHbO8AO4QU95XuUgK5EaikaXMw5q6+nTkHixk Y8zIKVlqsngyBcGLClI1bgeDaw/5O5lyq6dVvh41vxW8Ryj+0cOYWxpUcXRhW5tfFjLn 3BEb11lHbsqGlIrje3l6IRP2laSqWE+l7+0qRX/65ZgKOsNe1I0O0EsDJFdieYNaLItM Hf5w== 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=Ml7uB0OtQwcxX5TZhhBtWO2veCNQTvvwJhhIq0gQl44=; b=HjUFe4xyH/oEzr8Jh4AHvf+VMplIs8HAAQ5JEjfmqQLITVhK5zqKyh3Gx2m+skWaiT bSHaJmtobnpk6bPQO9iN8TsFY0M85Vs+tTfo+r1TBqQBUfdrHtNE9QRyLqniGUODzurg SLNVa4ckD4UFs3gRou4+70eTtlGOwMwl0lthm0HHUNz1VhIASwen5ASqpcjqzibgiZM6 jDlWetdiJrNyImNtivYdqTRl/v4Rn1vNbSk8Hsao3fRLMMsLWgOmG9AGlhwkWD/J4USw PpTSCmhRe04Z1aRMxKKrfj6+ZRiAdKy5pJcXm5i6IdgbFHib+XJNjWqPfrbHzDGJK+94 UxQA== X-Gm-Message-State: AOAM533fuYINmd14EGmoJhnuSOnvAFF8l8rA1kVX3UBG1kzmBZMIE9ut NNKQDrSSUsMciAkAkG60Fk2E4RLGYDO0BQ== X-Received: by 2002:a05:6a00:c84:b029:311:dced:c744 with SMTP id a4-20020a056a000c84b0290311dcedc744mr557641pfv.52.1625153145201; Thu, 01 Jul 2021 08:25:45 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id j4sm10213197pjv.7.2021.07.01.08.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 08:25:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 11/17] accel/tcg: Handle -singlestep in curr_cflags Date: Thu, 1 Jul 2021 08:25:31 -0700 Message-Id: <20210701152537.3330420-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210701152537.3330420-1-richard.henderson@linaro.org> References: <20210701152537.3330420-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.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: peter.maydell@linaro.org, mark.cave-ayland@ilande.co.uk, alex.bennee@linaro.org, f4bug@amsat.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Exchange the test in translator_use_goto_tb for CF_NO_GOTO_TB, and the test in tb_gen_code for setting CF_COUNT_MASK to 1. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 8 +++++++- accel/tcg/translate-all.c | 2 +- accel/tcg/translator.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 70ea3c7d68..2206c463f5 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -149,7 +149,13 @@ uint32_t curr_cflags(CPUState *cpu) { uint32_t cflags = cpu->tcg_cflags; - if (qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { + /* + * For singlestep and -d nochain, suppress goto_tb so that + * we can log -d cpu,exec after every TB. + */ + if (singlestep) { + cflags |= CF_NO_GOTO_TB | 1; + } else if (qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { cflags |= CF_NO_GOTO_TB; } diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index d0177d772d..586f8ca4ef 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1437,7 +1437,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, } QEMU_BUILD_BUG_ON(CF_COUNT_MASK + 1 != TCG_MAX_INSNS); - if (cpu->singlestep_enabled || singlestep) { + if (cpu->singlestep_enabled) { max_insns = 1; } diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 2ea5a74f30..a59eb7c11b 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -39,7 +39,7 @@ bool translator_use_goto_tb(DisasContextBase *db, target_ulong dest) } /* Suppress goto_tb in the case of single-steping. */ - if (db->singlestep_enabled || singlestep) { + if (db->singlestep_enabled) { return false; }