From nobody Mon Feb 9 18:00:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1680533321; cv=none; d=zohomail.com; s=zohoarc; b=T973vUTHLua0sshp/tkAEcnLFuCfdQjvAssAk7WUhzNYyYBv/8dpgeJJBvCuSHZWE0P5RvDkSU/XFEO0pXgrmOG+Uss1bC9sRJTiBJ+wCFE44fmKCaYusY6PaxYnBiP/7yT3x6vgZN+Tbr5R9EmxdT6wyHzmaWx8ap3ocfxB07M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680533321; h=Content-Type: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=3epTQBYW6Jzl8bhA8JL/NwcO0wptisWs4DJRdCAPoII=; b=d005Wfq3DIZ6h8VqQXICgZ8MHh2ZBIyYNOmY+OsSoRLkSwsZwVFzXUUto+9iOLBUJvY6vKnIzNzvwfIsDaQpBZH5zLqU2egOx6mYPjyHDAFKoKPzxFOCZ50hFLn2U/QUxeW/87FR6kk18dy+i7NPeooNaZM2iKd2NqM7qYFtubw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680533320907130.800400348121; Mon, 3 Apr 2023 07:48:40 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-140-tv5fYmkXOYWP-2mCbTcf7A-1; Mon, 03 Apr 2023 10:48:36 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 424413C11787; Mon, 3 Apr 2023 14:48:33 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E1CD112131E; Mon, 3 Apr 2023 14:48:33 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 02C3019472F9; Mon, 3 Apr 2023 14:46:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CDA8419465A8 for ; Mon, 3 Apr 2023 14:46:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A0CD62166B29; Mon, 3 Apr 2023 14:46:46 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 992FF2166B26 for ; Mon, 3 Apr 2023 14:46:46 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7DA4E185A7A9 for ; Mon, 3 Apr 2023 14:46:46 +0000 (UTC) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-201-LVRihizGOdutN6dRWj2ckQ-2; Mon, 03 Apr 2023 10:46:43 -0400 Received: by mail-wm1-f52.google.com with SMTP id v6-20020a05600c470600b003f034269c96so8046598wmo.4 for ; Mon, 03 Apr 2023 07:46:43 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p4-20020a056000018400b002c56013c07fsm9786747wrx.109.2023.04.03.07.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680533320; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3epTQBYW6Jzl8bhA8JL/NwcO0wptisWs4DJRdCAPoII=; b=EoGEqf2BiUbFVgVcTCR3NU3TCGNDQuyH6IvLHNGNl9SN5wZxFz/oHshDXfMSUFc0iGyKn6 Q7/VlwbXDw7o/39jFcnI1CJHlNfY6ilDNZxUhZHvsc0bbMjc05BEvcmVW+iB3o1wWr3IQE oNeGizyrNvNO2zrFtq62wpupyOXVi2A= X-MC-Unique: tv5fYmkXOYWP-2mCbTcf7A-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: LVRihizGOdutN6dRWj2ckQ-2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680533203; 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=3epTQBYW6Jzl8bhA8JL/NwcO0wptisWs4DJRdCAPoII=; b=qR+mf94YUQXt48nc9VJAJGdBBH/lENfi95r64jqGBRmjOzm5bfwsgUfT6Lj52BEc+Y hJODOHaVXMx0HNoi/VO6JmfFt2TgOx9XYjLTT19XYrmDsF/THKp/Fi5jvckBWNe43KZJ 7FvltqrP+r8dF5GIKpICh0wdi80cbXNRCtJimupTsycK9+9VWdNn2XCMaMaZttvnh18w iuSB/QjRBTFNJEnCs/R2aDJV4QDlc6CS60/mMZqTgHNinW3OIC4isgVZGCgGY/GhG5ME ggJieBx2FrakFLb6mXCxswIVhZ4cZfDfppQDYMkPU5y8eq2A2VYqg6D5PCwRveoV/6m7 hk2A== X-Gm-Message-State: AO0yUKWJvnHEKbhM1zdxaLLbFfKWCUBmckwrouz46CvC+Z1XJrIBd8YD DGTZIcZVOv6lBCGD/zELJJSJkA== X-Google-Smtp-Source: AK7set+xP3gfF+j8oxnNRd3t5FXyXZVPfyeg0UVQHEZEGl49R6I4Vn4aApCXnzJCw7ZRQc+CODZHJw== X-Received: by 2002:a1c:4b07:0:b0:3eb:2b88:a69a with SMTP id y7-20020a1c4b07000000b003eb2b88a69amr27060975wma.14.1680533203364; Mon, 03 Apr 2023 07:46:43 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v2 07/10] hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep' Date: Mon, 3 Apr 2023 15:46:34 +0100 Message-Id: <20230403144637.2949366-8-peter.maydell@linaro.org> In-Reply-To: <20230403144637.2949366-1-peter.maydell@linaro.org> References: <20230403144637.2949366-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: libvir-list@redhat.com, Kyle Evans , Richard Henderson , Markus Armbruster , "Dr. David Alan Gilbert" , Eric Blake , Warner Losh , Laurent Vivier Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680533322201100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The 'singlestep' HMP command 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 HMP command 'one-insn-per-tb', so we can document that 'singlestep' is just a deprecated synonym for it, and eventually perhaps drop it. We aren't obliged to do deprecate-and-drop for HMP commands, but it's easy enough to do so, so we do. Signed-off-by: Peter Maydell Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Richard Henderson --- docs/about/deprecated.rst | 9 +++++++++ include/monitor/hmp.h | 2 +- softmmu/runstate-hmp-cmds.c | 2 +- tests/qtest/test-hmp.c | 1 + hmp-commands.hx | 25 +++++++++++++++++++++---- 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 3c62671dac1..6f5e689aa45 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -199,6 +199,15 @@ accepted incorrect commands will return an error. User= s should make sure that all arguments passed to ``device_add`` are consistent with the documented property types. =20 +Human Monitor Protocol (HMP) commands +------------------------------------- + +``singlestep`` (since 8.1) +'''''''''''''''''''''''''' + +The ``singlestep`` command has been replaced by the ``one-insn-per-tb`` +command, which has the same behaviour but a less misleading name. + Host Architectures ------------------ =20 diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index fdb69b7f9ca..13f9a2dedb8 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -158,7 +158,7 @@ void hmp_info_vcpu_dirty_limit(Monitor *mon, const QDic= t *qdict); void hmp_human_readable_text_helper(Monitor *mon, HumanReadableText *(*qmp_handler)(Erro= r **)); void hmp_info_stats(Monitor *mon, const QDict *qdict); -void hmp_singlestep(Monitor *mon, const QDict *qdict); +void hmp_one_insn_per_tb(Monitor *mon, const QDict *qdict); void hmp_watchdog_action(Monitor *mon, const QDict *qdict); void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict); void hmp_info_capture(Monitor *mon, const QDict *qdict); diff --git a/softmmu/runstate-hmp-cmds.c b/softmmu/runstate-hmp-cmds.c index 127521a483a..76d1399ed85 100644 --- a/softmmu/runstate-hmp-cmds.c +++ b/softmmu/runstate-hmp-cmds.c @@ -41,7 +41,7 @@ void hmp_info_status(Monitor *mon, const QDict *qdict) qapi_free_StatusInfo(info); } =20 -void hmp_singlestep(Monitor *mon, const QDict *qdict) +void hmp_one_insn_per_tb(Monitor *mon, const QDict *qdict) { const char *option =3D qdict_get_try_str(qdict, "option"); AccelState *accel =3D current_accel(); diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c index b4a920df898..cb3530df722 100644 --- a/tests/qtest/test-hmp.c +++ b/tests/qtest/test-hmp.c @@ -64,6 +64,7 @@ static const char *hmp_cmds[] =3D { "screendump /dev/null", "sendkey x", "singlestep on", + "one-insn-per-tb on", "wavcapture /dev/null", "stopcapture 0", "sum 0 512", diff --git a/hmp-commands.hx b/hmp-commands.hx index bb85ee1d267..9afbb54a515 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -378,18 +378,35 @@ SRST only *tag* as parameter. ERST =20 + { + .name =3D "one-insn-per-tb", + .args_type =3D "option:s?", + .params =3D "[on|off]", + .help =3D "run emulation with one guest instruction per tran= slation block", + .cmd =3D hmp_one_insn_per_tb, + }, + +SRST +``one-insn-per-tb [off]`` + 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 accelerato= rs. + + If called with option off, the emulation returns to normal mode. +ERST + { .name =3D "singlestep", .args_type =3D "option:s?", .params =3D "[on|off]", - .help =3D "run emulation in singlestep mode or switch to nor= mal mode", - .cmd =3D hmp_singlestep, + .help =3D "deprecated synonym for one-insn-per-tb", + .cmd =3D hmp_one_insn_per_tb, }, =20 SRST ``singlestep [off]`` - Run the emulation in single step mode. - If called with option off, the emulation returns to normal mode. + This is a deprecated synonym for the one-insn-per-tb command. ERST =20 { --=20 2.34.1