From patchwork Mon Apr 3 14:46:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 669790 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp1926000wrt; Mon, 3 Apr 2023 07:48:40 -0700 (PDT) X-Google-Smtp-Source: AKy350b4ZKLqKHTjDRFJXRNg3rrFcHsCd9UvkPupPQNEgsRo8FkT8d0VZKk/mXE/22bX3xPNS3Mx X-Received: by 2002:ad4:5961:0:b0:56e:a6bb:47ae with SMTP id eq1-20020ad45961000000b0056ea6bb47aemr59563287qvb.12.1680533320465; Mon, 03 Apr 2023 07:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680533320; cv=none; d=google.com; s=arc-20160816; b=lFUNuWyMoyu1ifEhuIFn6h0L9LQdEp1kg4vK5oXcrmKfyXyQXO4ou7ukBki588j2Z9 oInq+BTUi1S0IgV00IC1FXV+9iLYUq2m6ke4FBPRum8YH3mpdtA0VF7ChCF4oSbr7keF RaHEc9rmeHZ1WJ5xvDW3SZgaqNeV/qOPA66cf++rP6LGkHV7LiwvJIXkaSvABJhv2G5c j5OpbZzc1eyuQjRAZjXVzLwVGBH+6lVofrp69Azi+1I/yoYfqQcAlbxcic8uqbHvDlej u7TVG9Z1xRQvdvvqPEaxuyFpvrm70Iqvdqv4ukTFO7kT2ShqNDr06nawAZYHlx8915tI c+OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=3epTQBYW6Jzl8bhA8JL/NwcO0wptisWs4DJRdCAPoII=; b=jgZJBKyDmGtzgfZEZ9ge4XFgDkpgPnTumNsojO6RyrqBTYCCMxTX2J73JqVqVikLTb ONiseF4z8/R/keQGjXPs6VYka55sp+r7XgHpAZ5FxOq5m3BNCK9KD1lU2V8YZmSakF+E ysyDV7/9Cw6UCWtLBuUFR9weYFAQw3F4Nvl7XqhOlOGSZCn0W7TgCqkbk1ZtVARDhVvU ZCArY0WP0O0vPRELvgElXLwOzcxTelVgBNkr3fbJvQTLoDGM318ZZZe6SGkdKFUIAkfP B670NQmgbVp/pAVJAnW6bUAx8vdFsjX1had+bRPvgvjDWMz+7gXYw7tfOqsNp2+D0ELf 8t/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EoGEqf2B; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id o5-20020a375a05000000b007484a622bbbsi5910026qkb.174.2023.04.03.07.48.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:48:40 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EoGEqf2B; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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= 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 X-MC-Unique: tv5fYmkXOYWP-2mCbTcf7A-1 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) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com 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) Delivered-To: libvir-list@redhat.com 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 X-MC-Unique: LVRihizGOdutN6dRWj2ckQ-2 Received: by mail-wm1-f52.google.com with SMTP id v6-20020a05600c470600b003f034269c96so8046598wmo.4 for ; Mon, 03 Apr 2023 07:46:43 -0700 (PDT) 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-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) 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) 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 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. Users should make sure that all arguments passed to ``device_add`` are consistent with the documented property types. +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 ------------------ 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 QDict *qdict); void hmp_human_readable_text_helper(Monitor *mon, HumanReadableText *(*qmp_handler)(Error **)); 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); } -void hmp_singlestep(Monitor *mon, const QDict *qdict) +void hmp_one_insn_per_tb(Monitor *mon, const QDict *qdict) { const char *option = qdict_get_try_str(qdict, "option"); AccelState *accel = 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[] = { "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 + { + .name = "one-insn-per-tb", + .args_type = "option:s?", + .params = "[on|off]", + .help = "run emulation with one guest instruction per translation block", + .cmd = 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 accelerators. + + If called with option off, the emulation returns to normal mode. +ERST + { .name = "singlestep", .args_type = "option:s?", .params = "[on|off]", - .help = "run emulation in singlestep mode or switch to normal mode", - .cmd = hmp_singlestep, + .help = "deprecated synonym for one-insn-per-tb", + .cmd = hmp_one_insn_per_tb, }, 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 {