From patchwork Mon Apr 17 16:40:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673839 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604395wrs; Mon, 17 Apr 2023 09:41:03 -0700 (PDT) X-Google-Smtp-Source: AKy350aqzy6HTJMmpKNyfjRRuGnkfiPZ3Ni+anhIBvOihnXmxED9T7GaASEE+SqvJwLr1t24tbu7 X-Received: by 2002:ac8:5f4a:0:b0:3ed:a2f5:f27c with SMTP id y10-20020ac85f4a000000b003eda2f5f27cmr9265715qta.12.1681749663757; Mon, 17 Apr 2023 09:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749663; cv=none; d=google.com; s=arc-20160816; b=je9EYfbywGWMSVyie1K78N7umBKZwo0Cav6IymHQr2XVEsx0zPnMVF8BVKmKIxR9Hz opZnks3cEGIcJUQsxbO2wU30QPtx9tq/j7StCRWVgOsCR1UmFt4pzir04tBVqMh1PQBA gfkGtrf3gVkYRGXd2MqKGQPcpSh3TDFHMmA+8k2kUZOOwpRxR5jloFY31T4VS4DPm+lL BSqZKIIaUBnqlEdG8OF4n4RtioxhZsXdPGGmtEUhddN2I52Xzs0I+UPL2wi+ZnZM5nS+ hwIWT7NZY900mcXvQyzlG3bN/0Fq0hbuUKlo4oilZAz2yWqd7NJM5s8rYI33yzmTHs8u bLpA== 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=olvshQStKsCnUjtp8KyqUOdEyAZzY1YXfVY0j5oOc5Q=; b=h48Reokj1NLO0LRvmM/Cgmt+XhdQaRmOeX7/CvpwRLYWxOAe3AkyftJDoLyQyaLN1o 9WAda0YD+CSL8x9VJirjtxNUz3IjUXimTe73iT927jT7EQ9zJ2WZx9qY4F6easO/qXxz y+ZB1Wl7OUsh8sNelWbda5ZU8YJfHrjp2HNOmvcoyNBUW36AgerMwM2bCHzftb5h8T2C +MaaA7RyRBIKlqPId0up+ri09j4JWoI6kLSMNjnS0UKRAQSFfEsZas0MvfKxir90xunW eQjmbfqzu2twEzzHtSQsNaVwh5VOdSeVEwurgB/cotky62geDq6nnxPim1jY/Ul4K0Kc BxCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DWcIjH7S; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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.129.124]) by mx.google.com with ESMTPS id p8-20020a05622a048800b003e4dc89fc28si5798768qtx.590.2023.04.17.09.41.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:41:03 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DWcIjH7S; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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=1681749663; 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=olvshQStKsCnUjtp8KyqUOdEyAZzY1YXfVY0j5oOc5Q=; b=DWcIjH7S/mCMnqMVbltvyQe3zyW2JTbigGN/fAN9T+Xtr5Ak4eQkKHjzJhPIC74gaDjtIp b3meAHmReE5n7lofOrIes4OCpBWo4T8xISgFX0sUB3jMOdUhUstOrA9c8BK8kBohvbOJ6S N63kzGJ+L3/lRPpfy5JDJTeFBzcp3Wg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-459-mdTIDOTlNhaZ7RHniLO-7A-1; Mon, 17 Apr 2023 12:40:55 -0400 X-MC-Unique: mdTIDOTlNhaZ7RHniLO-7A-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4A37885D540; Mon, 17 Apr 2023 16:40:49 +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 37038492B0C; Mon, 17 Apr 2023 16:40:49 +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 28637194658C; Mon, 17 Apr 2023 16:40:49 +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-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B7111194658C for ; Mon, 17 Apr 2023 16:40:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9B0B4492B10; Mon, 17 Apr 2023 16:40:46 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 931EC492B03 for ; Mon, 17 Apr 2023 16:40:46 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (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 745E785D539 for ; Mon, 17 Apr 2023 16:40:46 +0000 (UTC) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-590-tI4gztk9NV-pjhkWClHrMA-1; Mon, 17 Apr 2023 12:40:44 -0400 X-MC-Unique: tI4gztk9NV-pjhkWClHrMA-1 Received: by mail-wm1-f48.google.com with SMTP id n9-20020a05600c4f8900b003f05f617f3cso20138581wmq.2 for ; Mon, 17 Apr 2023 09:40:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749643; x=1684341643; 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=olvshQStKsCnUjtp8KyqUOdEyAZzY1YXfVY0j5oOc5Q=; b=G4qiEBUVFpQm5axWFZ0DxorcEalmaBIAcCqFjFSMk/yx4d/V7i5bAxljG/NRJNcXIn wYUFaZn26jsV4IKW9E8hUcq68yL1g09MtjSY4pdZv5CoJL4vwzOUR9a4zaOMRvbS0vZf QB0JDUuAeQLr1UMoyoiR/SyxzmAS+EO8NggiDf06FiUHNsFuult5FJDgsvGPPbBAPw4I AFOzmjWar9Dl9/SW8xcqTD1iRvKx0w67ZfcAMKXZIn6ieV8idibR/Tufjg4VcIZuuI+a khgYJV5xxEnwlYXyrS/36QYqy3eZkBLb5DuVLFPwzqk8a5i+7vK+GL+2KbUQLu3pCIC4 g7TQ== X-Gm-Message-State: AAQBX9diOwTNlhIFsA0He/qWNaBvb8xGqegYL8H7dET6qSRozuP1tFCM bhgoMEgLQvfCcaqEbHP1sbpn/w== X-Received: by 2002:a05:600c:ac9:b0:3f1:6f44:ff3a with SMTP id c9-20020a05600c0ac900b003f16f44ff3amr4788135wmr.13.1681749643483; Mon, 17 Apr 2023 09:40:43 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:43 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 01/10] make one-insn-per-tb an accel option Date: Mon, 17 Apr 2023 17:40:32 +0100 Message-Id: <20230417164041.684562-2-peter.maydell@linaro.org> In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-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.10 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 , Laurent Vivier , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org This commit adds 'one-insn-per-tb' as a property on the TCG accelerator object, so you can enable it with -accel tcg,one-insn-per-tb=on It has the same behaviour as the existing '-singlestep' command line option. We use a different name because 'singlestep' has always been a confusing choice, because it doesn't 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 (such as analysing debug logs). The existing '-singlestep' commandline options are decoupled from the global 'singlestep' variable and instead now are syntactic sugar for setting the accel property. (These can then go away after a deprecation period.) The global variable remains for the moment as: * what the TCG code looks at to change its behaviour * what HMP and QMP use to query and set the behaviour In the following commits we'll clean those up to not directly look at the global variable. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- accel/tcg/tcg-all.c | 21 +++++++++++++++++++++ bsd-user/main.c | 8 ++++++-- linux-user/main.c | 8 ++++++-- softmmu/vl.c | 17 +++++++++++++++-- qemu-options.hx | 7 +++++++ 5 files changed, 55 insertions(+), 6 deletions(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index 5dab1ae9dd3..fcf361c8db6 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -42,6 +42,7 @@ struct TCGState { AccelState parent_obj; bool mttcg_enabled; + bool one_insn_per_tb; int splitwx_enabled; unsigned long tb_size; }; @@ -208,6 +209,20 @@ static void tcg_set_splitwx(Object *obj, bool value, Error **errp) s->splitwx_enabled = value; } +static bool tcg_get_one_insn_per_tb(Object *obj, Error **errp) +{ + TCGState *s = TCG_STATE(obj); + return s->one_insn_per_tb; +} + +static void tcg_set_one_insn_per_tb(Object *obj, bool value, Error **errp) +{ + TCGState *s = TCG_STATE(obj); + s->one_insn_per_tb = value; + /* For the moment, set the global also: this changes the behaviour */ + singlestep = value; +} + static int tcg_gdbstub_supported_sstep_flags(void) { /* @@ -245,6 +260,12 @@ static void tcg_accel_class_init(ObjectClass *oc, void *data) tcg_get_splitwx, tcg_set_splitwx); object_class_property_set_description(oc, "split-wx", "Map jit pages into separate RW and RX regions"); + + object_class_property_add_bool(oc, "one-insn-per-tb", + tcg_get_one_insn_per_tb, + tcg_set_one_insn_per_tb); + object_class_property_set_description(oc, "one-insn-per-tb", + "Only put one guest insn in each translation block"); } static const TypeInfo tcg_accel_type = { diff --git a/bsd-user/main.c b/bsd-user/main.c index babc3b009b6..09b84da190c 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -50,6 +50,7 @@ #include "target_arch_cpu.h" int singlestep; +static bool opt_one_insn_per_tb; uintptr_t guest_base; bool have_guest_base; /* @@ -386,7 +387,7 @@ int main(int argc, char **argv) } else if (!strcmp(r, "seed")) { seed_optarg = optarg; } else if (!strcmp(r, "singlestep")) { - singlestep = 1; + opt_one_insn_per_tb = true; } else if (!strcmp(r, "strace")) { do_strace = 1; } else if (!strcmp(r, "trace")) { @@ -444,9 +445,12 @@ int main(int argc, char **argv) /* init tcg before creating CPUs and to get qemu_host_page_size */ { - AccelClass *ac = ACCEL_GET_CLASS(current_accel()); + AccelState *accel = current_accel(); + AccelClass *ac = ACCEL_GET_CLASS(accel); accel_init_interfaces(ac); + object_property_set_bool(OBJECT(accel), "one-insn-per-tb", + opt_one_insn_per_tb, &error_abort); ac->init_machine(NULL); } cpu = cpu_create(cpu_type); diff --git a/linux-user/main.c b/linux-user/main.c index fe03293516a..489694ad654 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -69,6 +69,7 @@ char *exec_path; char real_exec_path[PATH_MAX]; int singlestep; +static bool opt_one_insn_per_tb; static const char *argv0; static const char *gdbstub; static envlist_t *envlist; @@ -411,7 +412,7 @@ static void handle_arg_reserved_va(const char *arg) static void handle_arg_singlestep(const char *arg) { - singlestep = 1; + opt_one_insn_per_tb = true; } static void handle_arg_strace(const char *arg) @@ -777,9 +778,12 @@ int main(int argc, char **argv, char **envp) /* init tcg before creating CPUs and to get qemu_host_page_size */ { - AccelClass *ac = ACCEL_GET_CLASS(current_accel()); + AccelState *accel = current_accel(); + AccelClass *ac = ACCEL_GET_CLASS(accel); accel_init_interfaces(ac); + object_property_set_bool(OBJECT(accel), "one-insn-per-tb", + opt_one_insn_per_tb, &error_abort); ac->init_machine(NULL); } cpu = cpu_create(cpu_type); diff --git a/softmmu/vl.c b/softmmu/vl.c index ea20b23e4c8..492b5fe65e6 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -182,6 +182,7 @@ static const char *log_file; static bool list_data_dirs; static const char *qtest_chrdev; static const char *qtest_log; +static bool opt_one_insn_per_tb; static int has_defaults = 1; static int default_serial = 1; @@ -2220,7 +2221,19 @@ static int do_configure_accelerator(void *opaque, QemuOpts *opts, Error **errp) qemu_opt_foreach(opts, accelerator_set_property, accel, &error_fatal); - + /* + * If legacy -singlestep option is set, honour it for TCG and + * silently ignore for any other accelerator (which is how this + * option has always behaved). + */ + if (opt_one_insn_per_tb) { + /* + * This will always succeed for TCG, and we want to ignore + * the error from trying to set a nonexistent property + * on any other accelerator. + */ + object_property_set_bool(OBJECT(accel), "one-insn-per-tb", true, NULL); + } ret = accel_init_machine(accel, current_machine); if (ret < 0) { if (!qtest_with_kvm || ret != -ENOENT) { @@ -2955,7 +2968,7 @@ void qemu_init(int argc, char **argv) qdict_put_str(machine_opts_dict, "firmware", optarg); break; case QEMU_OPTION_singlestep: - singlestep = 1; + opt_one_insn_per_tb = true; break; case QEMU_OPTION_S: autostart = 0; diff --git a/qemu-options.hx b/qemu-options.hx index 59bdf67a2c5..1dffd36884e 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -182,6 +182,7 @@ DEF("accel", HAS_ARG, QEMU_OPTION_accel, " igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n" " kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n" " kvm-shadow-mem=size of KVM shadow MMU in bytes\n" + " one-insn-per-tb=on|off (one guest instruction per TCG translation block)\n" " split-wx=on|off (enable TCG split w^x mapping)\n" " tb-size=n (TCG translation block cache size)\n" " dirty-ring-size=n (KVM dirty ring GFN count, default 0)\n" @@ -210,6 +211,12 @@ SRST ``kvm-shadow-mem=size`` Defines the size of the KVM shadow MMU. + ``one-insn-per-tb=on|off`` + Makes the TCG accelerator put only one guest instruction into + each 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. + ``split-wx=on|off`` Controls the use of split w^x mapping for the TCG code generation buffer. Some operating systems require this to be enabled, and in From patchwork Mon Apr 17 16:40:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673834 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604318wrs; Mon, 17 Apr 2023 09:40:56 -0700 (PDT) X-Google-Smtp-Source: AKy350aBKtznhPml1Q6xQquHoppHq//3pRRL0nJ/ouPkH1UKE5rVAdmX/tE0hxtsyYxlVpSHBY15 X-Received: by 2002:a05:6214:da2:b0:5ef:6718:f8c7 with SMTP id h2-20020a0562140da200b005ef6718f8c7mr12955384qvh.38.1681749656334; Mon, 17 Apr 2023 09:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749656; cv=none; d=google.com; s=arc-20160816; b=QZEqP7ptJcFxxUa/uJ2o0KSbIZAY8tXtUcZufjKsvYiylJuy9Xa2cTAL8fOC7G1Wnd 4pzOu+N/6IHUSEoLiw3LN1hx81L8QIiC/zmdnw81px68p5ZzG1XrXopY+2vwfR87pD6g gd73TFloOtK6W68F1RnLLSWZsNbKiQyvi2GSEmI+oLUBxDQKYHIWUFCCd+RVX43EF1Bn 8Lt3esci4OjUX7jpVojIaiHhNeFHojxF56GLf4b+/uq6TKQOHN+ZUmKlOs0OpEPP6d2r WL8oLNwrWiwQcVE0o/3pBBTD9AtDuH+IbA7LQ0pxeWguU/oI58z13I5/IKGoF4QGLLS9 WPCQ== 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=exlqhHtpNYfOagC4ag8CmHQpsGR3QrEyzrEn9wP3FGw=; b=UZ8nN4SG3BSAx/qtfxduwuqAvdJjPEh4LptpYKpu3dZEwPuugd6BXi5v0VeV5gKgHK tZUbVRkWo9qE0p7mKRXLJaAlH/LCuANKkSHwLXUe/khhYqp+O9YXk9vvo3IeOV43xoX5 himq6r/bRdxRLLigekkt7+j2RNxVY0jcRYZzQq26DYMXWlBVR4IDMS1/FIKJngxq3WL8 Ow3AEXHzmprXafvKXmWu9FANLEgiD4jSm1iUNtoW4FgygcMtuPBxJXpkYcE0HTfCGU0S lQaMEcgjqUdUoeN2ddkHBGdCvrRsUtvMHUeIwzImosvIUL0uPDwZfvHNjuMWmJpx2lbT BXVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HvnZgaIV; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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.129.124]) by mx.google.com with ESMTPS id az11-20020a05620a170b00b0074ac1063ab6si5902266qkb.133.2023.04.17.09.40.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HvnZgaIV; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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=1681749655; 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=exlqhHtpNYfOagC4ag8CmHQpsGR3QrEyzrEn9wP3FGw=; b=HvnZgaIVomETx748k9cMhkwiy3L1AJyY5ylBI+62S+AhTgG27sMEBDc00yeA7USmuHZ+Xp UT1K3pH/6jxzNcQSsTnqFEJ+Mu21cHXLQhMqW9yE4f3SgbAZTTqorvWs51InfGMWzfxSQB Xj9dET+1peeFQoEdD1JEseizOwmC3Ws= 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-185-4Lp8O4pDP8aG-CRdO0B1dQ-1; Mon, 17 Apr 2023 12:40:51 -0400 X-MC-Unique: 4Lp8O4pDP8aG-CRdO0B1dQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 105BE381497B; Mon, 17 Apr 2023 16:40:49 +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 E8964492B0C; Mon, 17 Apr 2023 16:40:48 +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 E0F9A19465BD; Mon, 17 Apr 2023 16:40:47 +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 327D1194658C for ; Mon, 17 Apr 2023 16:40:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 257202166B29; Mon, 17 Apr 2023 16:40:47 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1DF332166B26 for ; Mon, 17 Apr 2023 16:40:47 +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 F1B66101A531 for ; Mon, 17 Apr 2023 16:40:46 +0000 (UTC) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-373-g22Vk6QJNy-AJhJW5BWyaw-1; Mon, 17 Apr 2023 12:40:45 -0400 X-MC-Unique: g22Vk6QJNy-AJhJW5BWyaw-1 Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-2f917585b26so1288225f8f.0 for ; Mon, 17 Apr 2023 09:40:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749644; x=1684341644; 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=exlqhHtpNYfOagC4ag8CmHQpsGR3QrEyzrEn9wP3FGw=; b=iuv277Zm6ttbdoAgKihmncZEAdDudNRINdiVhx3suQPoZbEzNRFo4e1KucInXNfkuD iT4/60zL9OeEne6GXv03V2YeuP5n4VRsHtD5Yk0fFBnFaEJ2AdYqc+ytviGKpRSQgHse fD1eGN2P1HPL8DFnROUOZnlT7HdcUxAxnSY3/ZKKBt8G/hVc5DjYGO4MpvWNyx2rBYUM CEIyddAThPZWj5YRkgW1pNZVi3Q5czCarL8TUtETeG1SFfJuOZk7vo6MfvP5FhDWnmCZ S+4b8GMrtoz82I7+/JPPvW7Xo4NTcEdXDOCAqONwpXGwPCGWJBlFR1oyppqJjQl5yM7p eplw== X-Gm-Message-State: AAQBX9dm/VIIMPJV8fMKlyg/QUFTWGWjskYsKCuMsfT8H7YLmXNdVajc 1/EfNLI3TYshMnTvfxbz5R8vgA== X-Received: by 2002:a5d:4cc6:0:b0:2f8:a7c0:5ce7 with SMTP id c6-20020a5d4cc6000000b002f8a7c05ce7mr5685549wrt.8.1681749644100; Mon, 17 Apr 2023 09:40:44 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:43 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 02/10] softmmu: Don't use 'singlestep' global in QMP and HMP commands Date: Mon, 17 Apr 2023 17:40:33 +0100 Message-Id: <20230417164041.684562-3-peter.maydell@linaro.org> In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-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 , Laurent Vivier , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org The HMP 'singlestep' command, the QMP 'query-status' command and the HMP 'info status' command (which is just wrapping the QMP command implementation) look at the 'singlestep' global variable. Make them access the new TCG accelerator 'one-insn-per-tb' property instead. This leaves the HMP and QMP command/field names and output strings unchanged; we will clean that up later. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- softmmu/runstate-hmp-cmds.c | 18 ++++++++++++++++-- softmmu/runstate.c | 10 +++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/softmmu/runstate-hmp-cmds.c b/softmmu/runstate-hmp-cmds.c index d55a7d4db89..127521a483a 100644 --- a/softmmu/runstate-hmp-cmds.c +++ b/softmmu/runstate-hmp-cmds.c @@ -20,6 +20,7 @@ #include "qapi/error.h" #include "qapi/qapi-commands-run-state.h" #include "qapi/qmp/qdict.h" +#include "qemu/accel.h" void hmp_info_status(Monitor *mon, const QDict *qdict) { @@ -43,13 +44,26 @@ void hmp_info_status(Monitor *mon, const QDict *qdict) void hmp_singlestep(Monitor *mon, const QDict *qdict) { const char *option = qdict_get_try_str(qdict, "option"); + AccelState *accel = current_accel(); + bool newval; + + if (!object_property_find(OBJECT(accel), "one-insn-per-tb")) { + monitor_printf(mon, + "This accelerator does not support setting one-insn-per-tb\n"); + return; + } + if (!option || !strcmp(option, "on")) { - singlestep = 1; + newval = true; } else if (!strcmp(option, "off")) { - singlestep = 0; + newval = false; } else { monitor_printf(mon, "unexpected option %s\n", option); + return; } + /* If the property exists then setting it can never fail */ + object_property_set_bool(OBJECT(accel), "one-insn-per-tb", + newval, &error_abort); } void hmp_watchdog_action(Monitor *mon, const QDict *qdict) diff --git a/softmmu/runstate.c b/softmmu/runstate.c index d1e04586dbc..2f2396c819e 100644 --- a/softmmu/runstate.c +++ b/softmmu/runstate.c @@ -40,6 +40,7 @@ #include "qapi/error.h" #include "qapi/qapi-commands-run-state.h" #include "qapi/qapi-events-run-state.h" +#include "qemu/accel.h" #include "qemu/error-report.h" #include "qemu/job.h" #include "qemu/log.h" @@ -234,9 +235,16 @@ bool runstate_needs_reset(void) StatusInfo *qmp_query_status(Error **errp) { StatusInfo *info = g_malloc0(sizeof(*info)); + AccelState *accel = current_accel(); + /* + * We ignore errors, which will happen if the accelerator + * is not TCG. "singlestep" is meaningless for other accelerators, + * so we will set the StatusInfo field to false for those. + */ + info->singlestep = object_property_get_bool(OBJECT(accel), + "one-insn-per-tb", NULL); info->running = runstate_is_running(); - info->singlestep = singlestep; info->status = current_run_state; return info; From patchwork Mon Apr 17 16:40:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673844 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604453wrs; Mon, 17 Apr 2023 09:41:09 -0700 (PDT) X-Google-Smtp-Source: AKy350ZMGcFtAxbMIS4O+VSU6+4nkxZwQ2Je3aObgVR0F6iNtI7ZsPl/voyccIewbHia/O14Ipiq X-Received: by 2002:ad4:5baf:0:b0:5b4:1d9a:75e7 with SMTP id 15-20020ad45baf000000b005b41d9a75e7mr17946885qvq.13.1681749669811; Mon, 17 Apr 2023 09:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749669; cv=none; d=google.com; s=arc-20160816; b=FVETloo1GXiEb6AZUprDsKuIq/VUO99k0ndVud/JsBOX/Eak2BQf0jXKneudetMPxm Jmg/Mub2uNhTNrbbQEQoft4XSrvwTJvxTlytbbW62Ad4zMP1VIR5L4CdT+SMBdI7f1kg 55TEHWFQWsfoo1pfrGy3MFYR8USaaBc7ADhxGfOBoWPnxwFMuaa+YXCk8UxYFoptXdpN ytx7foD2oQKjhYHnYUgXjWJEXBG6CsGc710B5pCSq9XWek2bpqG6lHo4lTEO3BKQ/9GQ /PJTUihsFYBBXSAWyzr/uwnp8S7JCKyi7yIOq+VR/GOCGKR8v3ynDpnYZM+lTACBKfl4 koew== 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=Gs+iC0C5OHKEybS9WeBQh25/t1gv+/9yrwaTYs2naWg=; b=kx95k9tFoqB5SkEK/fVIMfhUWKQYD95oq7tuSlyQrKdGFdX8b9BO5IDDQt+nlF0wd2 NZn8aM4mTRq/WkvjQC/S2ifbg8YtID4gRQipsTqMobYJ8R7hhRAkpujgV0VWb4PZkul9 dZm6YlbJ5gYEu3usAmMQ4s+ZA7Fhei8kT2akhFCFjg+SRxdLX6chXXbDQrY7FZFplKJ0 UIgVBLC5DdRJxUgwOVzKio3/IoTV2VmdQlPTKahdzFUIwBSiDOdlKkKGmHLrmmbAWBMD 2ZQp3ixGoQ/Ul0MWPN8er/VuOQq7nOoekJnI09ct2x8w0dFlRab2x63zLL+YskXICJI+ O0Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MOApy0CY; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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.129.124]) by mx.google.com with ESMTPS id js6-20020a0562142aa600b0058beac18028si5748585qvb.75.2023.04.17.09.41.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:41:09 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MOApy0CY; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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=1681749669; 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=Gs+iC0C5OHKEybS9WeBQh25/t1gv+/9yrwaTYs2naWg=; b=MOApy0CYXg/2NlUtN6trqhEhZzhnrAqV6FwtrwlFS6zXuWQwm/jDFC0HwkfE5nSkL/ErRh 3jSuzOK0qAie/+S/cdtWHB7ZN1AZVH3Bxp9vk3BEc79sdcqguJ+3RNO5h3OwVfgtb14wlA 9n/IkeUgexwsokpjdrLVDAOXgHxDMdY= 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-583-2sE8uLyTNhioJeA0YraUJw-1; Mon, 17 Apr 2023 12:41:01 -0400 X-MC-Unique: 2sE8uLyTNhioJeA0YraUJw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D4C731C00ADE; Mon, 17 Apr 2023 16:40:55 +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 86720492B13; Mon, 17 Apr 2023 16:40:55 +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 5F1D719465A3; Mon, 17 Apr 2023 16:40:55 +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-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0EC77194658C for ; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E65ACC15E7F; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF145C15BA0 for ; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 C3ACE88B7A0 for ; Mon, 17 Apr 2023 16:40:50 +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-168-f5rn4Sr6Mg-d8uiaf-prWg-1; Mon, 17 Apr 2023 12:40:46 -0400 X-MC-Unique: f5rn4Sr6Mg-d8uiaf-prWg-1 Received: by mail-wm1-f52.google.com with SMTP id d8-20020a05600c3ac800b003ee6e324b19so13412991wms.1 for ; Mon, 17 Apr 2023 09:40:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749645; x=1684341645; 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=Gs+iC0C5OHKEybS9WeBQh25/t1gv+/9yrwaTYs2naWg=; b=dKoF2Ez8oIL+CCenAGhdgKfTExl45bvtH2IkQUqWcoCk1pF6AjfiiEa/RayQQz/2JD g3+CPJJyk/8vdEMC2+fK/S6D36oFAb3vviIzfynnDSYDDb8eFPF01Jle9wKbpGXura5X DnNuGfmSHNCyDBOgNQTmSsG7tWUdwszGoq0+zIim3Z0634q3G9kQts8GxTWb3BfGm4Fe PlJnhGxgWmxsAo8vQwAkgXfFvlUQlncpY4FueHPvgUj8so7qSTKsoJmDKXRdBqNsympW iCxbdw1gFoNfDvRGVB20xiQSIvrtERpid9jn/lcMeV+b4UE39iqLLrQj/hkstc0VQJi2 VndQ== X-Gm-Message-State: AAQBX9c/Bm17LgPwHRsVa/eXp1QmE8D+5u66Y6Rty7tUysOMc8qH1nO7 PWEG2JDFpPpGkqeGdIRYDPLL9Q== X-Received: by 2002:a05:600c:2051:b0:3f1:6ec5:bc6e with SMTP id p17-20020a05600c205100b003f16ec5bc6emr6279173wmg.3.1681749644708; Mon, 17 Apr 2023 09:40:44 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:44 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 03/10] accel/tcg: Use one_insn_per_tb global instead of old singlestep global Date: Mon, 17 Apr 2023 17:40:34 +0100 Message-Id: <20230417164041.684562-4-peter.maydell@linaro.org> In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-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.8 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 , Laurent Vivier , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org The only place left that looks at the old 'singlestep' global variable is the TCG curr_cflags() function. Replace the old global with a new 'one_insn_per_tb' which is defined in tcg-all.c and declared in accel/tcg/internal.h. This keeps it restricted to the TCG code, unlike 'singlestep' which was available to every file in the system and defined in multiple different places for softmmu vs linux-user vs bsd-user. While we're making this change, use qatomic_read() and qatomic_set() on the accesses to the new global, because TCG will read it without holding a lock. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- In discussion on v2, we talked about combining this with the 'nochain' flag so as to have a single 'tcg_cflags_global' that held the flags for the current (one_insn_per_tb, nochain) state. I have not attempted that here, because it's a little tricky: * util/log.c is built into some binaries that don't have an accelerator at all (the tools), so it can't simply call current_accel() to get the TCG accelerator * the initial value of the logging flags is set before the TCG accelerator is even created So I leave that to somebody else to have a go at if they like. --- accel/tcg/internal.h | 2 ++ include/exec/cpu-common.h | 2 -- accel/tcg/cpu-exec.c | 2 +- accel/tcg/tcg-all.c | 6 ++++-- bsd-user/main.c | 1 - linux-user/main.c | 1 - softmmu/globals.c | 1 - 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index 96f198b28b4..7bb0fdbe149 100644 --- a/accel/tcg/internal.h +++ b/accel/tcg/internal.h @@ -67,4 +67,6 @@ static inline target_ulong log_pc(CPUState *cpu, const TranslationBlock *tb) extern int64_t max_delay; extern int64_t max_advance; +extern bool one_insn_per_tb; + #endif /* ACCEL_TCG_INTERNAL_H */ diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 6feaa40ca7b..0be74f1e706 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -163,8 +163,6 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, void *ptr, size_t len, bool is_write); /* vl.c */ -extern int singlestep; - void list_cpus(const char *optarg); #endif /* CPU_COMMON_H */ diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 8370c92c05e..bc0e1c3299a 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -159,7 +159,7 @@ uint32_t curr_cflags(CPUState *cpu) */ if (unlikely(cpu->singlestep_enabled)) { cflags |= CF_NO_GOTO_TB | CF_NO_GOTO_PTR | CF_SINGLE_STEP | 1; - } else if (singlestep) { + } else if (qatomic_read(&one_insn_per_tb)) { 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/tcg-all.c b/accel/tcg/tcg-all.c index fcf361c8db6..a831f8d7c37 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -31,6 +31,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/accel.h" +#include "qemu/atomic.h" #include "qapi/qapi-builtin-visit.h" #include "qemu/units.h" #if !defined(CONFIG_USER_ONLY) @@ -110,6 +111,7 @@ static void tcg_accel_instance_init(Object *obj) } bool mttcg_enabled; +bool one_insn_per_tb; static int tcg_init_machine(MachineState *ms) { @@ -219,8 +221,8 @@ static void tcg_set_one_insn_per_tb(Object *obj, bool value, Error **errp) { TCGState *s = TCG_STATE(obj); s->one_insn_per_tb = value; - /* For the moment, set the global also: this changes the behaviour */ - singlestep = value; + /* Set the global also: this changes the behaviour */ + qatomic_set(&one_insn_per_tb, value); } static int tcg_gdbstub_supported_sstep_flags(void) diff --git a/bsd-user/main.c b/bsd-user/main.c index 09b84da190c..a9e5a127d38 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -49,7 +49,6 @@ #include "host-os.h" #include "target_arch_cpu.h" -int singlestep; static bool opt_one_insn_per_tb; uintptr_t guest_base; bool have_guest_base; diff --git a/linux-user/main.c b/linux-user/main.c index 489694ad654..c7020b413bc 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -68,7 +68,6 @@ char *exec_path; char real_exec_path[PATH_MAX]; -int singlestep; static bool opt_one_insn_per_tb; static const char *argv0; static const char *gdbstub; diff --git a/softmmu/globals.c b/softmmu/globals.c index 39678aa8c58..e83b5428d12 100644 --- a/softmmu/globals.c +++ b/softmmu/globals.c @@ -43,7 +43,6 @@ int vga_interface_type = VGA_NONE; bool vga_interface_created; Chardev *parallel_hds[MAX_PARALLEL_PORTS]; int win2k_install_hack; -int singlestep; int fd_bootchk = 1; int graphic_rotate; QEMUOptionRom option_rom[MAX_OPTION_ROMS]; From patchwork Mon Apr 17 16:40:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673840 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604421wrs; Mon, 17 Apr 2023 09:41:06 -0700 (PDT) X-Google-Smtp-Source: AKy350YHdmVCugjrSeyfnfqTWsXmEk37eCjlFSRj/s8Uv+y6nqJHyOjdOHGl2gmgZzvvme2GZyni X-Received: by 2002:a17:907:a08d:b0:94f:8f37:d4e with SMTP id hu13-20020a170907a08d00b0094f8f370d4emr2025407ejc.65.1681749666193; Mon, 17 Apr 2023 09:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749666; cv=none; d=google.com; s=arc-20160816; b=0KCRC6KcoHTYFe0372ozJw/DM5z0bOwrLboZ8ldCdpyDToF9EO6v7Sn/LVFzzKpEty MGY21LX0ewqFT5ZZRmOeIWP1b6FlHnMItiyvhTanF4nYnClNXuKsLO771cysyhPUMR56 YLEI7EHWTvDHhxpAMPR0jsHw4LmQHz/fkAVvnqVVT28yHMASXMj81njreQ3O/87n3WbU j/cKNP0sGyiXtXKn0moETj3pNQCQxW2kFcqiKueFqHYvOxzAvZGnytjdyLdlDN6Lm5d+ M38o0FWlz9VJR9gmiq52r628I8IJ6qeT5nZbk6nXAXS9s0bMfECE2JlAH+vRNIve8Vh/ xevA== 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=p6Rq6d1Hv/zkHtdwcgnd6mnoTvLT3U0+uR+FS829PXk=; b=Ss1IWTMGp3viSOh9hrqQARHyx4KX72YNqSMmEpQ/2zfpvErygqFUSj6AbIdjmht1Vp yROQZhIq5Sk/X8qiEXZczzp+KAFJdRFQKg9q5Mwo8o7yGBT74pJa3sI03ne5XaYGh1s2 jwxWYk6DJqeyAAuLgvQtHByPLU5qynIvqAqGotdD/Kx2I3JV/D9xv+qOserLZISqf7/t HSc+py/OigrhX+qVoys+rpWAFof5Z9FHgnP0KOQG5u8ECT023fbHFPTihRSWNWtP2G3X 81mcx58BR8Z9kuNbt4Dt0mSC4sYIB8vAda0WtzBLapdzgpc7WB1YsM9rabp4u2K87xMT o1qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dEg272d3; 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 fu30-20020a170907b01e00b0094ed24294dfsi7832882ejc.324.2023.04.17.09.41.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:41:06 -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=dEg272d3; 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=1681749665; 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=p6Rq6d1Hv/zkHtdwcgnd6mnoTvLT3U0+uR+FS829PXk=; b=dEg272d30u8YrMCPAS81/4Ycuau+jKSE1rtcXadNOpJowKDvdyd79hDMF38bGbJgkpMc1C EC3xubazEvrNcGKU6WNo82rmeAKOX9vA6/ejNhV8Y4ZPH1UhpU9YIg89iX0bLOQ/++9Gs4 k+mefqfOgG5eFHVsWrMOtXVovzC9+NA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-636-QSk2u_nhMU64qfn7P_SL9A-1; Mon, 17 Apr 2023 12:40:57 -0400 X-MC-Unique: QSk2u_nhMU64qfn7P_SL9A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7FEAA185A7A2; Mon, 17 Apr 2023 16:40:51 +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 6AC5614171BB; Mon, 17 Apr 2023 16:40:51 +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 575D91946594; Mon, 17 Apr 2023 16:40:51 +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-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 60FC419465BC for ; Mon, 17 Apr 2023 16:40:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 36CC540CFD3A; Mon, 17 Apr 2023 16:40:49 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E2E340B3ED8 for ; Mon, 17 Apr 2023 16:40:49 +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 0FA5E85D538 for ; Mon, 17 Apr 2023 16:40:49 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-605-eTdaZlLBPK-8m3LKOYvdpA-1; Mon, 17 Apr 2023 12:40:46 -0400 X-MC-Unique: eTdaZlLBPK-8m3LKOYvdpA-1 Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-2f40b891420so1711263f8f.0 for ; Mon, 17 Apr 2023 09:40:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749645; x=1684341645; 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=p6Rq6d1Hv/zkHtdwcgnd6mnoTvLT3U0+uR+FS829PXk=; b=OXWKsWc7fnoD6TPglP+jwA7cAKcUDMIurotlDjT+1hZGnBc6QRBFziZhphgRqHxj1H S+YzshkX/UL9GLvM710B7SyCEMYxPLe/D+RVKBbyogdY+NkWueM+iEf6zB0S8FA/4D85 C9MBYrPdw7RKDB7KXv78gaC8R++dcDP8nX8kqqgNDiCJp12PHEEVACfKmIAO5LdHLprT JoNOIQcN/xSgt0CMuq/bkgS65OKfejyrHmaIPdbYFMXPSkRcOSwAIXYOQ/F+kVuuLrX6 uRbs0ZugrdaFBAjuqkgmXv+hF3MR9zqj8YTTM+cDgXSr1gmhSd0LEvsnkc3BWi+Wges5 X6vQ== X-Gm-Message-State: AAQBX9e7qPAp/0d5rtjsQQLgM7Sn2nEtj/MzOXlxx4rp5j2LNUtljnhH cyDSOwVI9eLKQ+Of1xDkULqMyQ== X-Received: by 2002:adf:fd44:0:b0:2f4:15f3:271e with SMTP id h4-20020adffd44000000b002f415f3271emr5854630wrs.2.1681749645250; Mon, 17 Apr 2023 09:40:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:45 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 04/10] linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' Date: Mon, 17 Apr 2023 17:40:35 +0100 Message-Id: <20230417164041.684562-5-peter.maydell@linaro.org> In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-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.1 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 , Laurent Vivier , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org 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 Reviewed-by: Richard Henderson Reviewed-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé --- docs/user/main.rst | 7 ++++++- linux-user/main.c | 9 ++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/user/main.rst b/docs/user/main.rst index 6f2ffa080f7..f9ac701f4b1 100644 --- a/docs/user/main.rst +++ b/docs/user/main.rst @@ -93,8 +93,13 @@ Debug options: ``-g port`` Wait gdb connection to port +``-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. + ``-singlestep`` - Run the emulation in single step mode. + This is a deprecated synonym for the ``-one-insn-per-tb`` option. Environment variables: diff --git a/linux-user/main.c b/linux-user/main.c index c7020b413bc..5defe5a6db8 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -409,7 +409,7 @@ static void handle_arg_reserved_va(const char *arg) reserved_va = val ? val - 1 : 0; } -static void handle_arg_singlestep(const char *arg) +static void handle_arg_one_insn_per_tb(const char *arg) { opt_one_insn_per_tb = true; } @@ -500,8 +500,11 @@ static const struct qemu_argument arg_table[] = { "logfile", "write logs to 'logfile' (default stderr)"}, {"p", "QEMU_PAGESIZE", true, handle_arg_pagesize, "pagesize", "set the host page size to 'pagesize'"}, - {"singlestep", "QEMU_SINGLESTEP", false, handle_arg_singlestep, - "", "run in singlestep mode"}, + {"one-insn-per-tb", + "QEMU_ONE_INSN_PER_TB", false, handle_arg_one_insn_per_tb, + "", "run with one guest instruction per emulated TB"}, + {"singlestep", "QEMU_SINGLESTEP", false, handle_arg_one_insn_per_tb, + "", "deprecated synonym for -one-insn-per-tb"}, {"strace", "QEMU_STRACE", false, handle_arg_strace, "", "log system calls"}, {"seed", "QEMU_RAND_SEED", true, handle_arg_seed, From patchwork Mon Apr 17 16:40:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673836 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604383wrs; Mon, 17 Apr 2023 09:41:02 -0700 (PDT) X-Google-Smtp-Source: AKy350bh/8XD+fai1x5qrppG2LPkh7NNOx1q2y1PlNsRGkzlGNBmyx1EQjDd9tvK9UcQzEpUCs+Q X-Received: by 2002:a05:6214:2a86:b0:5ef:5033:f37b with SMTP id jr6-20020a0562142a8600b005ef5033f37bmr21300156qvb.41.1681749662703; Mon, 17 Apr 2023 09:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749662; cv=none; d=google.com; s=arc-20160816; b=If12YXJW0hj93IrW/NrlDDBy7EeIyrBCMthbdfVP79lxSzyaTB2c7EgARY81nkBaXk 37Wcgg4WC9DF8+fQxFwuOKJdC9EJea/0CngWPSzSI8lzB3am20js6FJ9mEpK0EcIRg3Y 4XCibFjZCEcPXP1kK4RuZTt7Q8eLUqLUjKbgGrnhWBGjxHVchmy8IiM6kfdzv+7eNmGJ 5gTjjEWvc0HAqCupJXsqvJA2BxuOUe1NYsGjpfdFcC1yl9OI0q5hZm5y53gc965NsTQx FL8PyviDSCxuIzK6U27xym3e9TPCHrqtpTCo8YZzX+e1NNCoaR3U2qG43O2yQGk56J4T LE7g== 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=9zh6XCv4IvteabEjdIcioL96syD6sHRMrwiuxQ8bgkY=; b=s175gnRqr9GFsE9uQsWr+/z/NPFWnYdpWs+AGeP2xk/US9uNWrl6pEwDSpx7Xz6yl3 1/aWq/MXznYzM/ciazWom/S55n2xnA5rbfyN+IbGUoZA3v/9zvSomI0pGvoA+29FyWWx fgfn3L1mtBNdJYXEJ2e1Lhxl1BwsSs9DqZeACwrkadImmiMV5+gTn5JxLQHfeawL1LDc qh5Uvn8fGfNMN7DmQtfmTUF97rbHRnD4C6w14mwPkM1rSn56XdEqSglhLEWKAWqQBbjw fGiaxyNDJUGMrJdrhNYguQab9NXovIEA/Ve2UpoPjp7VQ9vqhVh/yNA5I2h37kbfsttT poNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="OiU/VPhf"; 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 kl17-20020a056214519100b005ea2f1bc30csi5675993qvb.332.2023.04.17.09.41.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:41:02 -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="OiU/VPhf"; 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=1681749662; 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=9zh6XCv4IvteabEjdIcioL96syD6sHRMrwiuxQ8bgkY=; b=OiU/VPhfad9g3ohQeyR2kKjHJWhabLOxKOmq0zsOFRoUCjEwpY9GUlP6FW0Mme4+9y+Z2y LqzoGnSRJyr0n70M+4PXRJJQq8g1HhADnLoc76MzISJI2yR3vrd7mX60AlYe3nnQuNN9Kn fwVTCGmNJHTHuXhc6euqBaAMn1YFiVw= 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-494-RHpYvnkfMqSlw5fCRgQq8Q-1; Mon, 17 Apr 2023 12:40:59 -0400 X-MC-Unique: RHpYvnkfMqSlw5fCRgQq8Q-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0C5D738149DC; Mon, 17 Apr 2023 16:40:52 +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 EB4E3492B0C; Mon, 17 Apr 2023 16:40:51 +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 A0C4D1946A4E; Mon, 17 Apr 2023 16:40:51 +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-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1CA7C1946594 for ; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 113F6492B10; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0947F492B03 for ; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 E45B48631FF for ; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-307-wITpFqiUPmyN3MNvG8tUkA-1; Mon, 17 Apr 2023 12:40:47 -0400 X-MC-Unique: wITpFqiUPmyN3MNvG8tUkA-1 Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-3f174cf526aso4881425e9.0 for ; Mon, 17 Apr 2023 09:40:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749646; x=1684341646; 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=9zh6XCv4IvteabEjdIcioL96syD6sHRMrwiuxQ8bgkY=; b=JyU4cpWQwIlcIEsKG30DGn8fFRJN0XUOITqaja13yViHt+nV+L4g7N4jEQuBh1UvCg Micht0sqPbInhp8yiR6HQ6EzGn4Xydt7QzDjulTSavCUWYUX075C+F3HpWKRNVx0J9Un fVLWenCPiqcpG/uLaDVAnlLhYCGxGz2tbTnjDdRAnKOHyBSAuzryW0v5u+tUrl7p1XNk K1Wk+M5J/PbZYczvXWm11i2/40Xf9eaTy9xcSpTa1kw4s7uIRXPxICNNsajky6y8upK7 42qYEGsxgjsEIxkND+cuay9tzEjJW++u5h6/RXeSGeaGCfmZqk4YhLmNJA/MVKxZ/+XH Tkpg== X-Gm-Message-State: AAQBX9drG71XC6C9zTqrxc30helcF4O0P3urjjQWIBx4FkZ05IlIMEqh ZUW70twgQu2YrysZVgVUKCOMtg== X-Received: by 2002:adf:cc81:0:b0:2d5:39d:514f with SMTP id p1-20020adfcc81000000b002d5039d514fmr6574853wrj.65.1681749645865; Mon, 17 Apr 2023 09:40:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:45 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 05/10] bsd-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' Date: Mon, 17 Apr 2023 17:40:36 +0100 Message-Id: <20230417164041.684562-6-peter.maydell@linaro.org> In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-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.10 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 , Laurent Vivier , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org 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 Reviewed-by: Warner Losh Reviewed-by: Richard Henderson --- docs/user/main.rst | 7 ++++++- bsd-user/main.c | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/user/main.rst b/docs/user/main.rst index f9ac701f4b1..f4786353965 100644 --- a/docs/user/main.rst +++ b/docs/user/main.rst @@ -247,5 +247,10 @@ Debug options: ``-p pagesize`` Act as if the host page size was 'pagesize' bytes +``-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. + ``-singlestep`` - Run the emulation in single step mode. + This is a deprecated synonym for the ``-one-insn-per-tb`` option. diff --git a/bsd-user/main.c b/bsd-user/main.c index a9e5a127d38..cd8b2a670f7 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -162,7 +162,8 @@ static void usage(void) "-d item1[,...] enable logging of specified items\n" " (use '-d help' for a list of log items)\n" "-D logfile write logs to 'logfile' (default stderr)\n" - "-singlestep always run in singlestep mode\n" + "-one-insn-per-tb run with one guest instruction per emulated TB\n" + "-singlestep deprecated synonym for -one-insn-per-tb\n" "-strace log system calls\n" "-trace [[enable=]][,events=][,file=]\n" " specify tracing options\n" @@ -385,7 +386,7 @@ int main(int argc, char **argv) (void) envlist_unsetenv(envlist, "LD_PRELOAD"); } else if (!strcmp(r, "seed")) { seed_optarg = optarg; - } else if (!strcmp(r, "singlestep")) { + } else if (!strcmp(r, "singlestep") || !strcmp(r, "one-insn-per-tb")) { opt_one_insn_per_tb = true; } else if (!strcmp(r, "strace")) { do_strace = 1; From patchwork Mon Apr 17 16:40:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673841 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604425wrs; Mon, 17 Apr 2023 09:41:06 -0700 (PDT) X-Google-Smtp-Source: AKy350YnHrFlqsuxY2XK6QnuUDayb2mRxnfF9DD7vD1cdDMtBiL/3hls5+u3GxkuVfk3Dmv0xUuf X-Received: by 2002:a05:6214:410e:b0:5e7:b5c5:5558 with SMTP id kc14-20020a056214410e00b005e7b5c55558mr16552631qvb.44.1681749666399; Mon, 17 Apr 2023 09:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749666; cv=none; d=google.com; s=arc-20160816; b=qc/KqXfX7Cjd2xfRobbWOXCgDY/DCbzzowEDX8CgBbVdSWKneLTLREqzcyt0s6kZFt etjd+ngLisG+z/sHdpaH8psKFv89QuXZSxFBpKxfOll6iiV1pt3/Ox8+kqx6Dmxf24gm UG+p0Q3+iSH3YFRvEVlwOZUQNSN8/5OkEs2vTyLcEd28g8FI6Bz34glGXYhOGM+Fvfna PaITkG0nVX6gXV7Rmt/ckhR+C8G0ytWdahJKdQgNjYHzlIHKDt6BYVBJSICr/mxFjcu0 n082+9r8k5QCAJ9mgaAjLRgagbGOA9Bmbcc2juPLitPv3eM9nYBwrVLcR6nWJxui7QzU cgAw== 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=5vzGB5zyqexh5lZpRKf1Wm53aoZK4fu1hbifevUF8JI=; b=ZKsTAZBVx5lKWiWDW0XZhEkyiXK3KrZJyufCUWzIc9OJF2bvAXOqxdokLgy80GiLNR auwe16Uia2yxPSgrviORHzFNhRh6ar2wutIiIA2MmgiBEtf40FdZCgdvxoqEyH27kPjf ixBOKGJ3Go1wJedQt5qaqAIkW1aIvb6QJ1RTYlvTk8kRQmNcElXiwryknZj+AoMFdUMc L0EpwyCP+vUA1ZR3zE/Vaz/6BHsS+TL/Jb6MaqB3HJ0DJRRDOb25hg7uYw9E2frh3iIs 74gEppPQe88SVA/oKGuqNfOuoRwxQUgw0Bz0fHg2KBVnFAWAtbtBppQ4JNiqc7OiIE0G 40Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SW1aiImi; 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 8-20020ad45b88000000b005ea119e52f1si1549337qvp.486.2023.04.17.09.41.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:41:06 -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=SW1aiImi; 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=1681749666; 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=5vzGB5zyqexh5lZpRKf1Wm53aoZK4fu1hbifevUF8JI=; b=SW1aiImiUXqK7e5GfPy4LMTBucHfhwh4So8Qs5Iy3QmDyzax+nTLI+F0k0GzCHyZqqkxjm 2Bl9qlxBOJGdz/HpfIxE9CZ9rS2GEEAZ+FGSAwkmWR/q7l0Zz+W/OP488vENE9WhgCFn46 HyuUQ3ghiCFkEwrNzSOGqqi2weo0cms= 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-622-SiGJ8RuXMjCSbeFevytMXw-1; Mon, 17 Apr 2023 12:41:00 -0400 X-MC-Unique: SiGJ8RuXMjCSbeFevytMXw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A73063C10239; Mon, 17 Apr 2023 16:40:52 +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 5B48640C94AF; Mon, 17 Apr 2023 16:40:52 +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 D7F121946594; Mon, 17 Apr 2023 16:40:51 +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-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 11EFD194658D for ; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 02BE840C83AC; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EF25340C20FA for ; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (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 D610C38149C1 for ; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-LSTfeY70OKSWk9RSFqP5Rg-1; Mon, 17 Apr 2023 12:40:47 -0400 X-MC-Unique: LSTfeY70OKSWk9RSFqP5Rg-1 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-3f169350f05so15375185e9.3 for ; Mon, 17 Apr 2023 09:40:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749646; x=1684341646; 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=5vzGB5zyqexh5lZpRKf1Wm53aoZK4fu1hbifevUF8JI=; b=R5EsePLbHwELz43EYr+I497NyDhzrnjWEx8cWZuATSmGFXNX1lSR+PFceFptLDiWdc 2jOK3r6e4v1VIHgruMwj12+pyTxqu9Ju7eva3R1mxiYPxba6Fr2mBETW7klhjG9ZGbDA WO9xN5rD0F0S+EOOi8Os7VgC7igBq8GzZcHKa0Pw4hTsev1f/xT5NFxE0utYixpL3fnh GitwAnuS1r5WFprC9GGvi99Y7uBiRKU2ghqBl1kAF1u//5+qE87Geg1RiY4RiBUD5MNi pU2stWhH+HRwilcMrUvDFJ62aKTpxRBidpqy/Sd7za/7OXno+9KCHa8YkmRwvpwtALtI jBNw== X-Gm-Message-State: AAQBX9e5ggqQ9XoIO9iiQcYMlYfNf0lh5fpmxkGIRxQB7UScciizCd67 b+JqZQRvsUoc0P1BdpTcG8YCXg== X-Received: by 2002:adf:e688:0:b0:2f4:62cc:922b with SMTP id r8-20020adfe688000000b002f462cc922bmr6648536wrm.16.1681749646377; Mon, 17 Apr 2023 09:40:46 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:46 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 06/10] Document that -singlestep command line option is deprecated Date: Mon, 17 Apr 2023 17:40:37 +0100 Message-Id: <20230417164041.684562-7-peter.maydell@linaro.org> In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-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.1 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 , Laurent Vivier , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Document that the -singlestep command line option is now deprecated, as it is replaced by either the TCG accelerator property 'one-insn-per-tb' for system emulation or the new '-one-insn-per-tb' option for usermode emulation, and remove the only use of the deprecated syntax from a README. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- docs/about/deprecated.rst | 16 ++++++++++++++++ qemu-options.hx | 5 +++-- tcg/tci/README | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 1ca9dc33d61..3c62671dac1 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -111,6 +111,22 @@ Use ``-machine acpi=off`` instead. The HAXM project has been retired (see https://github.com/intel/haxm#status). Use "whpx" (on Windows) or "hvf" (on macOS) instead. +``-singlestep`` (since 8.1) +''''''''''''''''''''''''''' + +The ``-singlestep`` option has been turned into an accelerator property, +and given a name that better reflects what it actually does. +Use ``-accel tcg,one-insn-per-tb=on`` instead. + +User-mode emulator command line arguments +----------------------------------------- + +``-singlestep`` (since 8.1) +''''''''''''''''''''''''''' + +The ``-singlestep`` option has been given a name that better reflects +what it actually does. For both linux-user and bsd-user, use the +new ``-one-insn-per-tb`` option instead. QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/qemu-options.hx b/qemu-options.hx index 1dffd36884e..6a59e997497 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4159,10 +4159,11 @@ SRST ERST DEF("singlestep", 0, QEMU_OPTION_singlestep, \ - "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL) + "-singlestep deprecated synonym for -accel tcg,one-insn-per-tb=on\n", QEMU_ARCH_ALL) SRST ``-singlestep`` - Run the emulation in single step mode. + This is a deprecated synonym for the TCG accelerator property + ``one-insn-per-tb``. ERST DEF("preconfig", 0, QEMU_OPTION_preconfig, \ diff --git a/tcg/tci/README b/tcg/tci/README index f72a40a395a..4a8b5b54018 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 - 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 -accel tcg,one-insn-per-tb=on once with interpreter and once without interpreter and compare the resulting qemu.log files. This is also useful to see the effects of additional From patchwork Mon Apr 17 16:40:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673835 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604366wrs; Mon, 17 Apr 2023 09:41:00 -0700 (PDT) X-Google-Smtp-Source: AKy350aiqP8Xlz9dBBORhQ/jsTm9pJBk2ztQwfz0iTXvTynp2R5bQXr57uZGO7/ok+Ym8X5MS7oF X-Received: by 2002:a05:622a:1a18:b0:3e1:7bb5:f0c5 with SMTP id f24-20020a05622a1a1800b003e17bb5f0c5mr23337302qtb.58.1681749660331; Mon, 17 Apr 2023 09:41:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749660; cv=none; d=google.com; s=arc-20160816; b=XDQJwqKjZNmzwa6dcfJdLTx7PTkc1qnc0KIX5QbQyzYvJF6vgBkcbSZ5GaSVdxEGAD 9cfVrn4NCngUShEzXoWU6N2vWYoQv20g7pzyQwGM1VkHj2fMYE4gB3dAIuztlxGjpSdR MlJZc+xdSm18MoJxVZIH3bn+fXLFQny0MbNk++wcCI+GPGETJOOzUkYz71axtL/6zpOE cWe2kWoCk4Vo9uSJsI4nwgPGEl6sPedEjxPrWpQa410vFTrhoP1T9kKPer9oqN27+2wp 6AFmGl6YwzHjtxylQ3qmL0KMdr5HdHrxAYrNpS4UjgE0jeXAMUmMK+Hs0Fq5R62Rrh+o yLsg== 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=IUG+bykQ/Oriq02A76XvnJLKzQfmPW2xVt1eESF/Lno=; b=y86p/YOtkDQW33Mm3+pE7DfdkMqVuYkUNNpcipFqWBkdjyt452tsR+VpSD+R1NqYdu yATjjjskg5sDdrd8CcTPQNuQoArTRh40Ty9EcC/1HyGt5f0LQlYS7CoaQRHnf0dUWn1I PNr4w3ZH93f9I30GjqXs6ovtbr6B2NZ7l0seXC3JrVRpIhngDeKZMwiRBowRhmLYJqS7 waJ2+uzV3qix4VqAWuAoVbyFVKxrjV/Xi+6KirPIaBzuiMRkN8VGPTdJVTb7zd5bLht+ N2lGqxpj3bC9/n5m0MIcx/cin8yaozALjZZSZXMNShb/T1cms7l8ka9keVyed7aCP6m8 suhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="NYnyh/k8"; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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.129.124]) by mx.google.com with ESMTPS id bm1-20020a05620a198100b007457afe9dccsi5824455qkb.465.2023.04.17.09.41.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:41:00 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="NYnyh/k8"; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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=1681749659; 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=IUG+bykQ/Oriq02A76XvnJLKzQfmPW2xVt1eESF/Lno=; b=NYnyh/k8IE4vtpJksPGsOuj4D1isvr4SjpReWL2nnvqAnQWnGNWByUVoi/5Vm4z41d1bOB gF9ZDFtICMS711Waz0bvZgDweYuZ6fhJqAsuY9DrxTvUD8q4xl5Qfuno9dRAujeDuVWMDw OOZY1vaGSvH4gu7UbKhKYnxpfNsHL2k= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-513-WyR2ZEryNTySIU0itK4BHg-1; Mon, 17 Apr 2023 12:40:58 -0400 X-MC-Unique: WyR2ZEryNTySIU0itK4BHg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B812210334A5; Mon, 17 Apr 2023 16:40:51 +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 A3A7340C6E6F; Mon, 17 Apr 2023 16:40:51 +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 80449194658C; Mon, 17 Apr 2023 16:40:51 +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-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7539F194658D for ; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5C621492B0F; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54F26492B03 for ; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 3C1083C0F691 for ; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-272-QgyqCFd8OGasrLIbwPma5Q-1; Mon, 17 Apr 2023 12:40:48 -0400 X-MC-Unique: QgyqCFd8OGasrLIbwPma5Q-1 Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-2f87c5b4635so1471303f8f.1 for ; Mon, 17 Apr 2023 09:40:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749647; x=1684341647; 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=IUG+bykQ/Oriq02A76XvnJLKzQfmPW2xVt1eESF/Lno=; b=Qu+fmdnn9fNj3fbONRQWNk56m0nKNgJ1rfLxmwxtFQywZe0Qvxn2hkkzLVr6Rngt6R HU0iYTcwOa0kci1CoGOKxF2UcRKLuZdomxQmX+mHYDd2QZgDfQ5kvdH/VAgk7jKLvOqS ahm4+VnU4def6AeFj2UDGiHXqZGIIhc2Uo52A/qm7pgb0M4MmZRwlsLvYosx5K9Aw4yY ry+qElleFeHLQRA64mJ7KfBWm/nQte7Oq/Ti4J4n9SUGpRWzxpt67I+TdYSJtMLK86d1 AliYhDSv4Oz5aymyx5xNqwjsn0xA3kwT/gr1bMiV0NcHxhRSZVcUvpeNNwNfrhWVYh8t yOFw== X-Gm-Message-State: AAQBX9eVTBR+neZAJOfRrKrus7y4iBxROClNAYADp4RyM7foOe3UVQv4 0UJ9IzjqqOy9/G06srJRWGC3Bg== X-Received: by 2002:adf:f40e:0:b0:2f4:cf53:c961 with SMTP id g14-20020adff40e000000b002f4cf53c961mr5470660wro.54.1681749646915; Mon, 17 Apr 2023 09:40:46 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:46 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 07/10] accel/tcg: Report one-insn-per-tb in 'info jit', not 'info status' Date: Mon, 17 Apr 2023 17:40:38 +0100 Message-Id: <20230417164041.684562-8-peter.maydell@linaro.org> In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-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.10 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 , Laurent Vivier , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Currently we report whether the TCG accelerator is in 'one-insn-per-tb' mode in the 'info status' output. This is a pretty minor piece of TCG specific information, and we want to deprecate the 'singlestep' field of the associated QMP command. Move the 'one-insn-per-tb' reporting to 'info jit'. We don't need a deprecate-and-drop period for this because the HMP interface has no stability guarantees. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- The new 'accelerator settings' subsection of the output currently only has one item, but it would be a place to put other stuff, eg if we wanted to mention whether split-wx is enabled. --- accel/tcg/monitor.c | 14 ++++++++++++++ softmmu/runstate-hmp-cmds.c | 5 ++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c index 1450e160e95..92fce580f11 100644 --- a/accel/tcg/monitor.c +++ b/accel/tcg/monitor.c @@ -7,6 +7,7 @@ */ #include "qemu/osdep.h" +#include "qemu/accel.h" #include "qapi/error.h" #include "qapi/type-helpers.h" #include "qapi/qapi-commands-machine.h" @@ -36,6 +37,18 @@ static void dump_drift_info(GString *buf) } } +static void dump_accel_info(GString *buf) +{ + AccelState *accel = current_accel(); + bool one_insn_per_tb = object_property_get_bool(OBJECT(accel), + "one-insn-per-tb", + &error_fatal); + + g_string_append_printf(buf, "Accelerator settings:\n"); + g_string_append_printf(buf, "one-insn-per-tb: %s\n\n", + one_insn_per_tb ? "on" : "off"); +} + HumanReadableText *qmp_x_query_jit(Error **errp) { g_autoptr(GString) buf = g_string_new(""); @@ -45,6 +58,7 @@ HumanReadableText *qmp_x_query_jit(Error **errp) return NULL; } + dump_accel_info(buf); dump_exec_info(buf); dump_drift_info(buf); diff --git a/softmmu/runstate-hmp-cmds.c b/softmmu/runstate-hmp-cmds.c index 127521a483a..a477838dc5a 100644 --- a/softmmu/runstate-hmp-cmds.c +++ b/softmmu/runstate-hmp-cmds.c @@ -28,9 +28,8 @@ void hmp_info_status(Monitor *mon, const QDict *qdict) info = qmp_query_status(NULL); - monitor_printf(mon, "VM status: %s%s", - info->running ? "running" : "paused", - info->singlestep ? " (single step mode)" : ""); + monitor_printf(mon, "VM status: %s", + info->running ? "running" : "paused"); if (!info->running && info->status != RUN_STATE_PAUSED) { monitor_printf(mon, " (%s)", RunState_str(info->status)); From patchwork Mon Apr 17 16:40:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673837 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604384wrs; Mon, 17 Apr 2023 09:41:03 -0700 (PDT) X-Google-Smtp-Source: AKy350bfQMbqPoongm4kPHkXbHu4aqMQbqfaWXGgWti92sXBbvHIswPG1Ilcjq+RxKTTrrO5jgax X-Received: by 2002:ad4:5b8b:0:b0:5b4:89b4:1b0a with SMTP id 11-20020ad45b8b000000b005b489b41b0amr13565460qvp.10.1681749663033; Mon, 17 Apr 2023 09:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749663; cv=none; d=google.com; s=arc-20160816; b=tBvIWFnxw0mApriNBuKW90PyS05md6QbEmxvRBEVUzatXjNBXBjQRpsEPLusu8Nj1b hT1OxBd+ZZnt5uM7e7ol/H+Dkf0X2ZpJwYvHcnY3+4pzv9hfeCP0saowiOs+upBsU3Bs aj6/Wc8p4DYHViaPb+Iu/eKOSYaY5FJ7jmV/DW0VjMDgMPgazH6vN5b/7hsPWlOM3j4N an9/bQRJNPcjMlllhXjXba0fnnE7vnw53ZjJho+1IgYultDXvu+6QND4S1/8yPB3tfYa LU7e/zoyuqFi34nDyJdF5r9mU6blDPucN5feWHwcLYXsb+0qPsDkRnLVL59nnWEExPkY KFVg== 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=XdrcDkwMacIqQO2KUO210mgRUqyMuFKPIP+LZZZwEDs=; b=BfRLzwcVMybRGWmPQH59A3IyNMHwbnA+X1WEJc1n2WqlLye2akBBcy7im1v4IX2rSa o1ycVtln5WFzAFajK6k6J3n3JW4kfNHVBW68VONosrP6jAdcPGyJ68zGriBOEGn1BlI6 HMi3B3EKCvVzZtsEYwkRncdhl+mMh1j1x5rOH3UPif+OsaooB99/Un5bK2YWwjDiiQTe CfHceWZHyl/Dq2oHY7Ri9/G5KHFYaJIib1qQJ/KsuCZX6pDRqoqDk0yWr4MJt0qJPvV4 JFCEiFeF6FhmpmWiQVqToow9PVMgShQqBNyoxhKEkXnKw0kejfnINnLYIl3J7qB1HCFx nCZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NC6VQ7k6; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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.129.124]) by mx.google.com with ESMTPS id fn5-20020ad45d65000000b005e625695a7csi1676110qvb.91.2023.04.17.09.41.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:41:03 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NC6VQ7k6; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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=1681749662; 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=XdrcDkwMacIqQO2KUO210mgRUqyMuFKPIP+LZZZwEDs=; b=NC6VQ7k6KxDn7vbiDPbzxfln4VfQSGQgUFN66j0K5KnAclUrku8o03+cGoDCan8j5suPZ2 zlTLI0+A/iPvBlOEnOCfHlPi8P9aRFmXZgm8Pe8/feL/jqL7B2iZ3fDhDEplDGJF6kC5FY nYiqXPp2g79MSr9tDodJemLL11YsbGY= 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-149-BDSFuX4GMJCdjZprBMahpg-1; Mon, 17 Apr 2023 12:40:59 -0400 X-MC-Unique: BDSFuX4GMJCdjZprBMahpg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4198A3C1024E; Mon, 17 Apr 2023 16:40:53 +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 2D2B751FF; Mon, 17 Apr 2023 16:40:53 +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 1E765194658D; Mon, 17 Apr 2023 16:40:53 +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-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E1454194658C for ; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B7112492B10; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF7D3492B0F for ; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 961AA85A5B1 for ; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-Lemr1kyINVu6daztPWDyAQ-1; Mon, 17 Apr 2023 12:40:49 -0400 X-MC-Unique: Lemr1kyINVu6daztPWDyAQ-1 Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f0a0c4e1ebso17180145e9.3 for ; Mon, 17 Apr 2023 09:40:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749647; x=1684341647; 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=XdrcDkwMacIqQO2KUO210mgRUqyMuFKPIP+LZZZwEDs=; b=OzeuCkW1jjAhrGUDVq4Xhfkfob8c+ccyH9WRMTUCABXZ9/t+IxOOfsMUxd/EfoEZnV UfYy0LkksXSrFhBpbny+VkR4PPOVZkjuhFA8kEaQs/ikhXfjoTiv90f9Os1kl/XwkslX QqzJR6Ndgy8AZK63G1MxMYCZZ9IUXbEbapxehbltaDfw3lk4RpKc/5YNSjZWhUdr4jec r1L+eOB6f+l3bN9QGZI3e2l850syKjWhBKfbX+mFCLq5rsuGGLNLdwbS6aSdg1MHNt6r Od2CAPTnrkxXKBXLrRF7nM8cmSGWF8oaqMl8AZ7oAQJB1uSCPlA284P5dj8XEzg/ufJK Wyxg== X-Gm-Message-State: AAQBX9frGLgW19sI/Fx/d2RmMgyQttuMhkNoW/hYVRZcd/36tW/d5mdB fEGcJc7Wtk5A5Hj8JC+jnOc5LA== X-Received: by 2002:adf:f547:0:b0:2fb:1d3a:93ff with SMTP id j7-20020adff547000000b002fb1d3a93ffmr2053433wrp.61.1681749647507; Mon, 17 Apr 2023 09:40:47 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:47 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 08/10] hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep' Date: Mon, 17 Apr 2023 17:40:39 +0100 Message-Id: <20230417164041.684562-9-peter.maydell@linaro.org> In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-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.10 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 , Laurent Vivier , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 Reviewed-by: Philippe Mathieu-Daudé --- 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 a477838dc5a..2df670f0c06 100644 --- a/softmmu/runstate-hmp-cmds.c +++ b/softmmu/runstate-hmp-cmds.c @@ -40,7 +40,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..6704be239be 100644 --- a/tests/qtest/test-hmp.c +++ b/tests/qtest/test-hmp.c @@ -56,6 +56,7 @@ static const char *hmp_cmds[] = { "o /w 0 0x1234", "object_add memory-backend-ram,id=mem1,size=256M", "object_del mem1", + "one-insn-per-tb on", "pmemsave 0 4096 \"/dev/null\"", "p $pc + 8", "qom-list /", 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 { From patchwork Mon Apr 17 16:40:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673842 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604431wrs; Mon, 17 Apr 2023 09:41:06 -0700 (PDT) X-Google-Smtp-Source: AKy350YuvkUXMDHdtBSQzyxc0rpMA7P6+xPuF2PeaIyoGZUteg9DO16r3W7D+uZaFmyG3My9Tltm X-Received: by 2002:a05:6214:c86:b0:5e8:66c:80f3 with SMTP id r6-20020a0562140c8600b005e8066c80f3mr16931728qvr.19.1681749666729; Mon, 17 Apr 2023 09:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749666; cv=none; d=google.com; s=arc-20160816; b=cz280IzoribViSw8yZr7coiXRX8ku4JXlbw9u2O5Bl7MMd0Rh/J8LJV+doVTc/o7Rt 5lszaN+Na/wfHQpWzZ0ChZvyGwusfmnx7SL9HQuCZ68XpUtyuSGRBIyZXmCJSHg+Rs0N gn6u2Q+CBiV8hIBf7HKpg3X3rk2UyZKS4sMiQkIqk92UzvimkDyoigh+IaX65WCnUTOs 2V8ReVWWs365WVx6pxFxuUAExkcbEH0DOsiLb95EAGHGC6KItSN1MeFBdIf0p6EfeSKX H827t1Az1lK//REIHJBmuqc/BhPkQACZ8qkg1vn/5nTStcuwEr1Lz237K3ePsPkN4QUu PuLA== 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=9/0TyOdhBrDuhL5XsvOLjbBITyKIzOif+YMbpV7tsp0=; b=BM/6UN1p9bU9QbnNeEVgAROALn9ZiWPeH30lUHJLLk5ljB+29Wh6lkcA9cMbPhlgal Hl4aDGT5Js6evqLP9+kKCjxxV9fDeOl1DESpax/Jl96cNdrYmW5OtRPhF+rc7JtHkr3z UgVLX47I2DiVLoIlKlUDos1cfWhokCUMRt96oeq/LBg7o/oY+4lTmKx/p29z40awUooC XMHW3HVfOyqXZyofiKRA4iwEyUvFlB7X1cjJ1+tAn3aRlUiZkASjhProhAG35Eb+aCFk q0JO7U5y1MD6EueBeSlkmCN7D59garFrnjEYWiO7Jrg3rYR+rNS58QGlXwxUWW7/7axy xyPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KygimyqU; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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.129.124]) by mx.google.com with ESMTPS id u22-20020ac858d6000000b003e630560118si5900397qta.724.2023.04.17.09.41.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:41:06 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KygimyqU; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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=1681749666; 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=9/0TyOdhBrDuhL5XsvOLjbBITyKIzOif+YMbpV7tsp0=; b=KygimyqUQGb7cw2/3R0gIFAboJdJhJPHSO2yA/vNlHX7iuJoG8FtjEhf+H2fzCXo7SEifw Ga2n2lDxsf8JJetysAf859Lqzpi1oF6+LWeVexGZl8QInkygiI4kYhyNEIqcGpewtPKqqD V+hULmtw1RNZYAt5KczlRcbWvTZC9g4= 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-127-B0s9A8VVNjqGiqjhH-eXXg-1; Mon, 17 Apr 2023 12:41:03 -0400 X-MC-Unique: B0s9A8VVNjqGiqjhH-eXXg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 04E471C0A58C; Mon, 17 Apr 2023 16:40:57 +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 E61E62166B2A; Mon, 17 Apr 2023 16:40:56 +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 AD7FE194658D; Mon, 17 Apr 2023 16:40:56 +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-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2F03B194658C for ; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 24A5B492B03; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1D1CD492B0F for ; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (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 03C5838149BD for ; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-20-WL8K160COXyuSQ6mcEIeKA-2; Mon, 17 Apr 2023 12:40:49 -0400 X-MC-Unique: WL8K160COXyuSQ6mcEIeKA-2 Received: by mail-wm1-f43.google.com with SMTP id m39-20020a05600c3b2700b003f170e75bd3so1668694wms.1 for ; Mon, 17 Apr 2023 09:40:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749648; x=1684341648; 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=9/0TyOdhBrDuhL5XsvOLjbBITyKIzOif+YMbpV7tsp0=; b=F1geArWQMd3P2mc3qJZ7CS6L58U2fRhUrkRIOLeea4746rocmXNmyBANccYRVUOCNA sPCv0UTBxm5W3gp/pFXFCmgax/Ad9M5QxtasBKVNa1Ryeml7AVi9yn+fwIGA6qwI8pkF pCe0S6qXYtvL2q+bkxGNdGWrmw9q0JTOXkAxZc3rH3IRTczqYGm4G+lWmyxJ4k5bM47y 6rG+T5ar26+PlJECzcMXrT4IwjTfPGIUHmIfrbkeKzOAKKNy5C9t8gWiLfiiyV1uZzXY lfuocmOsP+ut46H38Si0c0mHlcSPHM+84HCEhDoC0b1nkkKMCDaztyXGlhcFcHID7TEE E8nQ== X-Gm-Message-State: AAQBX9fR2B0DgGzAR4cB9V8hGRn7pzn9+egstllqgv7afkkJ2Jypp5tA JV3gfpXud5zp+xy+EUoAVncMvw== X-Received: by 2002:a05:600c:2288:b0:3eb:29fe:f911 with SMTP id 8-20020a05600c228800b003eb29fef911mr10891445wmf.13.1681749648121; Mon, 17 Apr 2023 09:40:48 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:47 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 09/10] qapi/run-state.json: Fix missing newline at end of file Date: Mon, 17 Apr 2023 17:40:40 +0100 Message-Id: <20230417164041.684562-10-peter.maydell@linaro.org> In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-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.10 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 , Laurent Vivier , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org The run-state.json file is missing a trailing newline; add it. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- Noticed this because my editor wanted to add the newline when I touched the file for the following patch... --- qapi/run-state.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/run-state.json b/qapi/run-state.json index 419c188dd1a..9d34afa39e0 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -663,4 +663,4 @@ # Since: 7.2 ## { 'enum': 'NotifyVmexitOption', - 'data': [ 'run', 'internal-error', 'disable' ] } \ No newline at end of file + 'data': [ 'run', 'internal-error', 'disable' ] } From patchwork Mon Apr 17 16:40:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673843 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604438wrs; Mon, 17 Apr 2023 09:41:07 -0700 (PDT) X-Google-Smtp-Source: AKy350YhAYr28ZZyZRomGJofbzuzgFpv5K7V0pfTMNU4XfFOBG5UUqIf2no/mezG69mffolDdF9w X-Received: by 2002:ac8:58cb:0:b0:3db:8942:cbd2 with SMTP id u11-20020ac858cb000000b003db8942cbd2mr24469291qta.61.1681749667620; Mon, 17 Apr 2023 09:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749667; cv=none; d=google.com; s=arc-20160816; b=hoDJaViZaCqDWadXq9u7kzB6sA7e4OODIWGfah9iC8FatoS69lJlOf5XVh5F9hktCv UANqxV/zD78A6tkF6o1K5mKz7ShXw42k8yx4iidf8qcbbAuQvMFKk3Vm1b1i2I3oB+bK hZKAXsSFc2wd2TBQmWGGl4yd2bDQEK4M9EnA8Gfne2Tyk3lAW+Bbr2nZOK2x6sRRRfL9 vfzwu33vDZl7HTQk6OvgN3KGPmXsMqJQdbwbUjV+kiLhzZz98S2gU9Pf7wt7OB7pKsP7 9h+DY6fTlSvqZAdSa1j16zmJWluRqCoualX2s47tZxIXJs5MxA7lsPgfN49xvs3BGgZ1 VI6g== 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=4B6l8UECJ90CPUbM7Klpck4y118EN0eBNxzC139Z/3k=; b=V6vJS9ao9ktxqh6wL1dUFCVuq+MiHbh3tsISHe2hADJWnwhMHgHDAfzMsIMcCcZaJc I0CbBytnQXuhZ3iv9/PJOUP2vL5tElKBx/nGFj/pX789ubULSABZgZKW5qkg+s2sEmW4 N80iZAOht1tbvJdthlmYf3NPAbWd/M+cLqBfe9bSfpSez8uq4+zE0rzeq6gXx8FEdA/U PNfmcfqOCDxatsuPfFlQGXtQJ/xUrQlSaGQ8q21lnUc/ZubmsYUG2iiaJrXj1Ip4IxDv WtjempkvkzwokzzYA2y613jVvmgExUmJ1roYBz36o4XJmxszO6gIqTqeXBt3wmx0ZfYi 40DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZPwQasHj; 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 2-20020ac85902000000b003e38d6c16f6si5715978qty.438.2023.04.17.09.41.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:41:07 -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=ZPwQasHj; 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=1681749667; 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=4B6l8UECJ90CPUbM7Klpck4y118EN0eBNxzC139Z/3k=; b=ZPwQasHjr5rlD1e5ezgIAsqXVNQtROHxyuB7zJEIREYELdbH2vJYGVB1wH4ctcnbUuYZVE cWXwXiGfv7fldvc0hVW/h/faVd2Ulrk09DO2/z51dJMryRAeHqCT2vSIVFttnp11UAdL/M BYd33pqx8zwFAILzcrLLvVtn2Mpqg4M= 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-86-3gOCnqXhOCe8xTI47ChJag-1; Mon, 17 Apr 2023 12:41:00 -0400 X-MC-Unique: 3gOCnqXhOCe8xTI47ChJag-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4C0503815F65; Mon, 17 Apr 2023 16:40:55 +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 37EBE40C6E70; Mon, 17 Apr 2023 16:40:55 +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 03FFE19465B1; Mon, 17 Apr 2023 16:40:55 +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-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 019F5194658C for ; Mon, 17 Apr 2023 16:40:54 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E9ED740C6E6E; Mon, 17 Apr 2023 16:40:53 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1B8640C94A9 for ; Mon, 17 Apr 2023 16:40:53 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (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 C78AF88F4DE for ; Mon, 17 Apr 2023 16:40:53 +0000 (UTC) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-417-n0ZJgt0LNYevaXn1BoBYhQ-2; Mon, 17 Apr 2023 12:40:49 -0400 X-MC-Unique: n0ZJgt0LNYevaXn1BoBYhQ-2 Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-2fa0ce30ac2so909844f8f.3 for ; Mon, 17 Apr 2023 09:40:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749648; x=1684341648; 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=4B6l8UECJ90CPUbM7Klpck4y118EN0eBNxzC139Z/3k=; b=DQFWMuG9qRQIibDGBAQIOLgoALpH6xuk37ny8r9fmlu72y/1lT/Hcvu9zloL2EVE09 b43KX3Np5X6Qqwvs32XJYbCLae1ElvSqiwCyWAZkjGi58IU/BzkFxo9lK8m3xlUSvtWK mSn4+H/Cw7PVWHByDEatobXeZ/PBYJtArTWiKpxeIYSyeoZ3tQZNMsh0xUZGOI3epzp4 lTLgycIqMiXoIsKw51WedOyAcPFEAZzTjDWWRz5yJrsT4K9WsGz+i7vrxOr0Re2kJjpV RfOhyBeyP0ASN6LZwi0HLHWDoO/AF4qY5etgZlbIO4pvA794EtO6G2CfRrS47MJ/CWaO xkIA== X-Gm-Message-State: AAQBX9ckWRM/0UltjeFTMWVDCXvPjI9p9ppgvnxens0EBTVtoVF8pDfe PBwHDdT/T9ICK3+ger2Q1Xr4nvXFc7EXpsAysg8= X-Received: by 2002:adf:f4cb:0:b0:2f5:aadb:4642 with SMTP id h11-20020adff4cb000000b002f5aadb4642mr6412555wrp.41.1681749648681; Mon, 17 Apr 2023 09:40:48 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:48 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 10/10] hmp: Deprecate 'singlestep' member of StatusInfo Date: Mon, 17 Apr 2023 17:40:41 +0100 Message-Id: <20230417164041.684562-11-peter.maydell@linaro.org> In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-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.2 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 , Laurent Vivier , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org The 'singlestep' member of StatusInfo has never done what the QMP documentation claims it does. What it actually reports is whether TCG is working in "one guest instruction per translation block" mode. We no longer need this field for the HMP 'info status' command, as we've moved that information to 'info jit'. It seems unlikely that anybody is monitoring the state of this obscure TCG setting via QMP, especially since QMP provides no means for changing the setting. So simply deprecate the field, without providing any replacement. Until we do eventually delete the member, correct the misstatements in the QAPI documentation about it. If we do find that there are users for this, then the most likely way we would provide replacement access to the information would be to put the accelerator QOM object at a well-known path such as /machine/accel, which could then be used with the existing qom-set and qom-get commands. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster --- For v3: because we're only deprecating the existing member, not trying to provide a replacement with a new name, we don't need to update the iotests that use the command. (We will when we eventually drop the deprecated member.) --- docs/about/deprecated.rst | 14 ++++++++++++++ qapi/run-state.json | 14 +++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 6f5e689aa45..d5eda0f566c 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -199,6 +199,20 @@ 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. +``StatusInfo`` member ``singlestep`` (since 8.1) +'''''''''''''''''''''''''''''''''''''''''''''''' + +The ``singlestep`` member of the ``StatusInfo`` returned from the +``query-status`` command is deprecated. This member has a confusing +name and it never did what the documentation claimed or what its name +suggests. We do not believe that anybody is actually using the +information provided in this member. + +The information it reports is whether the TCG JIT is in "one +instruction per translated block" mode (which can be set on the +command line or via the HMP, but not via QMP). The information remains +available via the HMP 'info jit' command. + Human Monitor Protocol (HMP) commands ------------------------------------- diff --git a/qapi/run-state.json b/qapi/run-state.json index 9d34afa39e0..daf03a6fe9c 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -104,16 +104,24 @@ # # @running: true if all VCPUs are runnable, false if not runnable # -# @singlestep: true if VCPUs are in single-step mode +# @singlestep: true if using TCG with one guest instruction +# per translation block # # @status: the virtual machine @RunState # +# Features: +# @deprecated: Member 'singlestep' is deprecated (with no replacement). +# # Since: 0.14 # -# Notes: @singlestep is enabled through the GDB stub +# Notes: @singlestep is enabled on the command line with +# '-accel tcg,one-insn-per-tb=on', or with the HMP +# 'one-insn-per-tb' command. ## { 'struct': 'StatusInfo', - 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} } + 'data': {'running': 'bool', + 'singlestep': { 'type': 'bool', 'features': [ 'deprecated' ]}, + 'status': 'RunState'} } ## # @query-status: