From patchwork Sat Jul 17 22:18:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 479260 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2746255jao; Sat, 17 Jul 2021 15:24:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4bIGaY2coVap3bmIp7WsEm9K0QaxFcvqOSq4Bh/zjH39ZrZQ+cthF3aoMWzYsIYmnWpMa X-Received: by 2002:a92:c989:: with SMTP id y9mr6672901iln.183.1626560694790; Sat, 17 Jul 2021 15:24:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626560694; cv=none; d=google.com; s=arc-20160816; b=hZVWxdAXqo75fPX66nQU9TJBmncdkIIfywyVhyEHDuDrzKqa1fBvzG4ORjER6UpTRX 6Jnmez6RGooTZFmAjyWGZBcIJby5cedtI8yRXc4y3ah0CL5BRwG7C9U+2a1qnbQBvqIm lx/79RqFs+CsaPS2hFNwLzzyeeyFYGM42Z0t0o/WXQiiw/z7ME7QRkQs/0BkyLu+5eYD ZtwZ+1/CxhlSghE9ZRidgKx2u/L+H1xriZZbqPuk/DFy9XI1NRrgFo68MiXEYszOVzoS y8n04px7sEG6yhUNz/dswIxelaZhiXSJ1cHJ5nlcbxgmX0fqxhEYb+63YRwrHlGQHtaf 45Iw== 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=ZOLiMEmN0a3chiS5zK6wK/UK5sFKrMRuxK04aSAiGGo=; b=h2H1i8EQZcueMTq9pplvtyyEko4RXdoEYs3OnapqSaCrU4HL0KHFYz4NBhDusq5/vH +NllVqQGIOHQ7Die/ufCKCtAkubacoR0/Jw3aqgF9dZ5FxgOp3NnuDi4E7BLaBtwoac0 TlpisDOvyrdtAltkEMEPQyiwpOiBsrkjeu/5X3oQmkzOtztkNzJNGuQyle26PilqTh/X Bft7Q+7SAiH1++m8IgyLqJ403kCVzLx/kQJePRpdd9ggSKu/Dokn1ZKxx/dtF6xUuT3o +27SaJeMEjsavk6nXFLpKNW5AYQeZtil/gX3SJ/su40YTLB3odhxuzrRo5+YE4p0XYmF HYwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hvtLbmo0; 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 y13si7945371ilu.34.2021.07.17.15.24.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Jul 2021 15:24:54 -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=hvtLbmo0; 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]:49278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4sjs-0001gc-70 for patch@linaro.org; Sat, 17 Jul 2021 18:24:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4seC-0006tZ-GG for qemu-devel@nongnu.org; Sat, 17 Jul 2021 18:19:00 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:38844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4seA-0001zS-EY for qemu-devel@nongnu.org; Sat, 17 Jul 2021 18:19:00 -0400 Received: by mail-pj1-x1035.google.com with SMTP id me13-20020a17090b17cdb0290173bac8b9c9so11571909pjb.3 for ; Sat, 17 Jul 2021 15:18:56 -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=ZOLiMEmN0a3chiS5zK6wK/UK5sFKrMRuxK04aSAiGGo=; b=hvtLbmo0JqQJRwVE3/R8/tB9fK/D+5mU1FdDgwGTIBfLkARVJLLdfS5pmU2LSoLx8J veNdRS7DNusqZFRFH7KvnhVIhgp3aL1qgo2epcBifeiJuzqLFt390INVUoKDMFv4Zjbk 7V1wg3tNKtBu2ea9h6869hg8U6oOtqkseztcxHNrEVKeQ3YULYDrILCZv9RBy9CJIaaR +s5emQ13KNC45EUVgiAOqxc/5GVkEUqGEkON68VFs8ay8PBwuUZXnlIKnGGLkogeGGci A+MCQeq/zLZG2jw/0zPQIXBxTq5yT5a1MxGpikRFxAFJ4w8MQuSxYdZtODzt94vN2fU/ yKkg== 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=ZOLiMEmN0a3chiS5zK6wK/UK5sFKrMRuxK04aSAiGGo=; b=etBzU5BUUHTtL9fgPqWGhF2iVMtoJ1JkSzqN3RkyAKOmRcAzfXJVvyOgjw3Nv0s1gu A/rcHcL7pwjaQRew+OSJBuhSviikaq+axlqMux3qVjGRxJMGRpDNgzAmiQgwKJSaiT/w r0uE+c1VcDj8z9OJDlyU+PyqtibQusV9dHsW2APaLaY0YQK8jVGZINgrLEWtH99RVepg vxyzG3RyDjTTQM5MkVt5EOIaFVe+3c8Ws3X+x3qfwh1Kb+BuUqnObNbz0vaUMWOxxjNM s/oXbsL3I5TDO5QpSKnelDZEN2LX9w+StzcrpjZDEnvchrIhwVXMGlC5l70xRzSbgwhA aqdQ== X-Gm-Message-State: AOAM533zjbhSqVtPezoOLmXuPYi9TqoFRwwEEhQY1tpvoCDE6jN9lgC9 q4kq9L1BTNwvgKod8laPYjDLeIzzyEr7Iw== X-Received: by 2002:a17:90a:86c6:: with SMTP id y6mr16353533pjv.16.1626560335840; Sat, 17 Jul 2021 15:18:55 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id n14sm2405091pjv.34.2021.07.17.15.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jul 2021 15:18:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 05/13] accel/tcg: Handle -singlestep in curr_cflags Date: Sat, 17 Jul 2021 15:18:43 -0700 Message-Id: <20210717221851.2124573-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717221851.2124573-1-richard.henderson@linaro.org> References: <20210717221851.2124573-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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. Reviewed-by: Peter Maydell 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 5cc01d693b..bf82c15aab 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1432,7 +1432,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; }