From patchwork Wed Jul 21 19:59: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: 483339 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp6528835jao; Wed, 21 Jul 2021 13:19:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQFdpiYtMKvqlfJG4kwxlXBH0Ilb1goAWxLySGOXUsKdNM0dWaslr04L4SsjUv1jdNN1iy X-Received: by 2002:a67:2d8b:: with SMTP id t133mr36958336vst.45.1626898770358; Wed, 21 Jul 2021 13:19:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626898770; cv=none; d=google.com; s=arc-20160816; b=jf7vTXGx4GrkPyw5SHWy09WHWcUtMorDPcoS5pRypE8Zim+B9/o7BnyrsfWklb3xki iS3gc3lkkkC97P9vlrrhwXUHxI+QWRXYF0frqiBhL7IKkAbuM6Q/2fWCD5neH6DWXlf3 KMp5ZXsa7+ywAGjWrV9CrHn/gaQY+pXOflnllX7a0bUebOvap3CxXLmi1sAnE3tpp4mn aRqgoEDSjBRN5OmpYuOD4HwBWVtuNtyLKj6QMvek9ANDaWu8+s2BFB09XoG0l8f3XSac PUBHg4S2fRLMZAit25DBmiUvx04MQwhQqvcgEBV7/fIQmdWcIsLgAtzu9sxB9oSp1Ne9 6epw== 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=kjlCqgWH6pPgYrklOenIkvHWm64/nMaB86DSmeNcAlg=; b=CuatfPF64p+YS/r7PAQapbKraeFT7OGzHmw5bLH11px9aCycFZtEbjSkAjcP7TzPDW nQsZuOwirOwyR+rbyHHX2ZOEHeAifu6palpwox7pEEwky3b4r+3YUV8ZZfqj+OF0j7Zn HT9HkypkjlSM+UQ9Vb34vPCD4aDp3y/i0CS5k0sFnBkduWsjk5r5HqaKkXIPipWodtCT E8Gt4wP89mF1zsN2RObCvZYAERXbptpkx7K8kPbHCbf9FnaECXh5HIHXL/0sRPKE+/y+ fb8def+lvFwdWSF5uKKC5WPX1dcSiVNWDg3gPZjEunnG2eSFP6Z2fBF7frGGCIriEwKA 1c/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YGjJCsV4; 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=pass (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 ay35si2414369vkb.17.2021.07.21.13.19.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jul 2021 13:19:30 -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=pass header.i=@linaro.org header.s=google header.b=YGjJCsV4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6Igj-0003O5-Kx for patch@linaro.org; Wed, 21 Jul 2021 16:19:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6IOH-0002xn-SS for qemu-devel@nongnu.org; Wed, 21 Jul 2021 16:00:29 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:40584) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6IOC-0005or-JJ for qemu-devel@nongnu.org; Wed, 21 Jul 2021 16:00:24 -0400 Received: by mail-pj1-x1031.google.com with SMTP id u9-20020a17090a1f09b029017554809f35so503632pja.5 for ; Wed, 21 Jul 2021 13:00:19 -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=kjlCqgWH6pPgYrklOenIkvHWm64/nMaB86DSmeNcAlg=; b=YGjJCsV4jW3tfALyF3pFrO4wnjAdq1xYzoYsQxpjmx398WULiH+gT3FaDttA+vGNq8 1X6BJdmTvO3k4bSMLEXD6B0clRfAdPfm4ac4WssAbkyTEjmU3XPiTg+eFs0ZoKxEjszY XcjI7z2JNGlDd875wY8SsET9imM5qm/8s1b1Ik6Px5BOIC596zbsB1ppP/vZGG1mWamm luy0DUIfZQBSEyMiWOUSqSdNTfKzTNB+3bCy90U4+1Y5RW36AyIBEvIwvjkL63WxSunE D2jKZFz5aHo9e8HOUIwMa/pp2gWo5HqpxKvoVrUDvUOFRgQ94Hmf/dWUJgPJjoAtEVSr qkug== 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=kjlCqgWH6pPgYrklOenIkvHWm64/nMaB86DSmeNcAlg=; b=mFHbLMre5BcGv4g3owRVyZ7gLX+tgGgWlutNxn/5CbzgJWH8jCxSJvcefaf4Ly0Cac PXP/JWWVlb5JMUpFumAaWx4IjGt5olo6RCLMLT4PUPhRJ08c9ckwKAlvStKhiI1nFt5n D7bdyKVZY2Xk66w7dsCr+WIrqZtLlvKHKtVgguCMgoWj4I1Iax12m6C0n8x4kZTRo26g d5+dt803QQwdjYgg/QAU3BYIRe/JDvmulkqbBVx1dlOaaQSHAhxpa258vdCOsoFsx5dK /oxgR/w3+DcHaN8yT3l+rflqtZw/0Ucvtx6Na5eSmra0iPxiPuCzweYTqk9dplN9ofFD sfIw== X-Gm-Message-State: AOAM532oTP1kVBj171jfGDdgl3rtqm9eyodXR6fFxWa0WXO6FmQ4fz3t J4+ShX4+oCy5oS4NiHcDKYh0cRe3psliOw== X-Received: by 2002:aa7:8b56:0:b029:2b9:77be:d305 with SMTP id i22-20020aa78b560000b02902b977bed305mr38364016pfd.61.1626897619053; Wed, 21 Jul 2021 13:00:19 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 13:00:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 16/27] accel/tcg: Handle -singlestep in curr_cflags Date: Wed, 21 Jul 2021 09:59:43 -1000 Message-Id: <20210721195954.879535-17-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::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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 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. Tested-by: Mark Cave-Ayland Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20210717221851.2124573-6-richard.henderson@linaro.org> --- 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; }