From nobody Mon Feb 9 11:34:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675703750; cv=none; d=zohomail.com; s=zohoarc; b=DP0BuSqg5evHOWSJiRk+14JWsskY0FOhCF4VyA2oPPdIDQGt0TaM49/CYxSakJrJVwwOZpxDXjR2qDQFEKVtiydZ0SnSn+8D3nDC/xPn54X0PHlCSS2vNjxQDPyp3APSVpD/Bq2sky0C9/Q+Yul25ggeG/TrUX7KheUn//4Fg+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675703750; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CMZp74yJ4afPsnw6Yc/ZceAsQ465N4IhpQ4ktRnsEtk=; b=Fr6bOQtFuP/xrLkphJyGfpjaUiqdAodn4YcR0tjTK+qaKVDpldM6q7E1s5+EN1AWwPgwg1IqqGf7UHzVtnM3gFbnsavoF3cbGGuj39fIrihjjbtg582adxxM+Xh3ljoBhE9xS+/bhwRP+wRiDpLmpI/O+tBiSczFZzMTGSrt87w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16757037505963.6136547564974535; Mon, 6 Feb 2023 09:15:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP54K-0000jh-Rh; Mon, 06 Feb 2023 12:14:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP54H-0000hy-2v for qemu-devel@nongnu.org; Mon, 06 Feb 2023 12:14:13 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP54C-0001Qs-QF for qemu-devel@nongnu.org; Mon, 06 Feb 2023 12:14:11 -0500 Received: by mail-wr1-x42a.google.com with SMTP id h3so3229334wrp.10 for ; Mon, 06 Feb 2023 09:14:07 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y10-20020a05600015ca00b002bfd137ecddsm9529841wry.11.2023.02.06.09.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 09:14:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CMZp74yJ4afPsnw6Yc/ZceAsQ465N4IhpQ4ktRnsEtk=; b=hLHro6a7JUkB6g+l68fFB4zvtMJIaTGCt+1zRswoktGwMtDLg6KV8w+Ypw0SXyllTm rj3UFdosRDxj9H2dT8Xhh57d6/kStojs+FhwQIOMQVGrM1NuPmVhpLvDzo4VHLDlyuPH 4B31g++gdHwTK5GhubeG+b7bFv8uYiGlPiivQBLai4rDjCleEVW0LspsOjOnXSsH8O92 GODftsepxJU7Pqm+GhPiE1R8pj6ZLqKsZFMvqozhWuA5oU2F2Imc7S7T3Ce30aKdhnrd 41aSfu0V2/RT+xXkm4oTOW7lHsbMWVEaH31mhTTYFrrPM3j3o0P7L/AfstWwsj93gmZw lFAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CMZp74yJ4afPsnw6Yc/ZceAsQ465N4IhpQ4ktRnsEtk=; b=rvXCAC2FMZ8knnYAvxH7JPYsi1fcGcJ234J8clYVn3T6Yy3pd90KN+bSdGDIHZW2qL kSyZNoQ4oPtOizvmf8+x7UFtPsQ0c6THqXpXIdRVb61bUQW+17/aHqlsL2sUvyAsNw0C cRYnxZ+SEnd656DOX0TMVtGHVjI+lO+q42pk9nqmf5Mh9BT++iCa2QgIgKAXf/9DG09J yP6IUcWobG4Km7EHi94FZF29mXwstcpZc3f27fwi114hPfAwyp0oTAYQYmRrPDdfCY0N NsOLiG142l55lypEnH3QMNPoUQC2HDq60B2lEncIhqSxPXJAdxOVlsK2DY0WKgCZRJ4T 0dxw== X-Gm-Message-State: AO0yUKXbuUzsrCRZ5ca83iwhcMDM3HR1hvxzwoDon7jdSwZxAMyJNvlI uShqEDuK1UtFghm0euyAQZgo+w7r1tPqxCI7 X-Google-Smtp-Source: AK7set+BOWSkM+yGV1y+/QJsn+DB9DK64jT1G2RR7tQy+JE0wFEcDVWdEYIpg88IQv4H10qY1qyzBQ== X-Received: by 2002:adf:ff90:0:b0:2c3:f0a6:43e3 with SMTP id j16-20020adfff90000000b002c3f0a643e3mr983048wrr.39.1675703646851; Mon, 06 Feb 2023 09:14:06 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , "Dr. David Alan Gilbert" , Laurent Vivier , Thomas Huth , Warner Losh , Kyle Evans , Markus Armbruster Subject: [RFC PATCH 4/5] softmmu: Add '-one-insn-per-tb' option equivalent to '-singlestep' Date: Mon, 6 Feb 2023 17:13:58 +0000 Message-Id: <20230206171359.1327671-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230206171359.1327671-1-peter.maydell@linaro.org> References: <20230206171359.1327671-1-peter.maydell@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=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675703751460100004 Content-Type: text/plain; charset="utf-8" The '-singlestep' option is confusing, because it doesn't actually have anything to do with single-stepping the CPU. What it does do is force TCG emulation to put one guest instruction in each TB, which can be useful in some situations. Create a new command line argument -one-insn-per-tb, so we can document that -singlestep is just a deprecated synonym for it, and eventually perhaps drop it. Signed-off-by: Peter Maydell --- softmmu/vl.c | 1 + qemu-options.hx | 14 ++++++++++++-- tcg/tci/README | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index dbe5124b5e7..61335ec7bc0 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2957,6 +2957,7 @@ void qemu_init(int argc, char **argv) qdict_put_str(machine_opts_dict, "firmware", optarg); break; case QEMU_OPTION_singlestep: + case QEMU_OPTION_one_insn_per_tb: one_insn_per_tb =3D 1; break; case QEMU_OPTION_S: diff --git a/qemu-options.hx b/qemu-options.hx index 88e93c61031..184f8cc36d0 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4158,11 +4158,21 @@ SRST from a script. ERST =20 +DEF("one-insn-per-tb", 0, QEMU_OPTION_one_insn_per_tb, \ + "-one-insn-per-tb run with one guest instruction per emulated TB\n= ", QEMU_ARCH_ALL) +SRST +``-one-insn-per-tb`` + Run the emulation with one guest instruction per translation block. + This slows down emulation a lot, but can be useful in some situations, + such as when trying to analyse the logs produced by the ``-d`` option. + This only has an effect when using TCG, not with KVM or other accelera= tors. +ERST + DEF("singlestep", 0, QEMU_OPTION_singlestep, \ - "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL) + "-singlestep deprecated synonym for -one-insn-per-tb\n", QEMU_ARCH= _ALL) SRST ``-singlestep`` - Run the emulation in single step mode. + This is a deprecated synonym for the -one-insn-per-tb option. ERST =20 DEF("preconfig", 0, QEMU_OPTION_preconfig, \ diff --git a/tcg/tci/README b/tcg/tci/README index f72a40a395a..751558f2892 100644 --- a/tcg/tci/README +++ b/tcg/tci/README @@ -49,7 +49,7 @@ The only difference from running QEMU with TCI to running= without TCI should be speed. Especially during development of TCI, it was very useful to compare runs with and without TCI. Create /tmp/qemu.log by =20 - qemu-system-i386 -d in_asm,op_opt,cpu -D /tmp/qemu.log -singlestep + qemu-system-i386 -d in_asm,op_opt,cpu -D /tmp/qemu.log -one-insn-p= er-tb =20 once with interpreter and once without interpreter and compare the resulti= ng qemu.log files. This is also useful to see the effects of additional --=20 2.34.1