From nobody Sun May 19 18:49:41 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1681751491; cv=none; d=zohomail.com; s=zohoarc; b=iLtcrgsM1+Nem3ZwJQa58Eseb5dFD2XDESFtiV78Xn7ZZaTG9vPdM/qNkyqs31VRZ6xjJGW2T49249Y5IVle2AlUnjUnstm9/os33xNpHjDQWVNotMLTd/VAeSDT8pVrR6Du9kGSt4t7l973rS1gp0g+NgtZuwpKXF1HqgXTUMY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681751491; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=olvshQStKsCnUjtp8KyqUOdEyAZzY1YXfVY0j5oOc5Q=; b=BQkWeh4/rVKej59teK31ZkAOuui7E/EdOSV7378GLk6uzQES00kGmn8VOiFpTVTDlVGmQ+pcE3Xpo7nT8hm2M1patSaWsI/ugRnt+z3hTFv73He9Fcu3GlmrQyjcrPKiJcuUCVuZahpyzdGqcAqwCFTAdK2GDX/ECB9E7EePOas= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681751491068391.55192439496; Mon, 17 Apr 2023 10:11:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poRuL-0002JU-Vq; Mon, 17 Apr 2023 12:40:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poRuK-0002IQ-CS for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:48 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poRuI-0001Le-21 for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:48 -0400 Received: by mail-wm1-x335.google.com with SMTP id hg25-20020a05600c539900b003f05a99a841so21351703wmb.3 for ; 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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681749643; x=1684341643; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=olvshQStKsCnUjtp8KyqUOdEyAZzY1YXfVY0j5oOc5Q=; b=ViRJWPeI2tbuWAFjs1wlwiA//l3ppT+RVxhVQkRAY25JfaMjoCRztNP/UQw5Cep1MO hzwdqXafvHdFwRYF1CJrmwBOBtnIXxI7Jux+s6fJJbfKr5XcLYOheWzdGyhN/eb0fGBY tILGhyPHCvJKKWY3LAQbWL5FVGvNo9Qy5iU9Jv0yuIJwKrkvknR+8Xx+VIwWZfJmUX5U eAdbfGpu9To840DMYlbOceoqbigknBOllov2CrB00fpxIWS1uYA69bdb1kMY7fN+dNHM kesgb8CGMOlIsLr9FC1iSRKdJdpglST3C9p9tpBkb6jPv+odeRQWmKRn9034YJW0wvBy wkxg== 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=CcN13/RqB1/pKS0mmaOl1bMYuvKrl+oIeF+Equw6/4eGDCCXbgJC4ZEhM3C2Z1GWzP USfhcb3bGLgHF74FQ9+82uKwf1jYPTRBomYG8e1U/IkdUEYF2zRE50TxSrbCKj1D9if0 40Dq5b7O3wESQR//9cxi1tA/sUdZ9+dcRltM09DBC4O/uTfoLqU4MimtcDEFe2PJTisC vwH9WQI/C/gOd3nI3aQNylKG8MbcGFHiMiT61uEUD1axrH04aAliE/OxFkHMNB9l+MYS 2chauAzjRBo5aEHNybRLAWg7+mnrQoBfvQGr7yKE41WWmzIhnwKOmEYV9AsCWZ2+KoW9 q7zA== X-Gm-Message-State: AAQBX9cexz9KUHwmfC4UDm70LF58imWtqrRG7lsp0Elo4gQz+oHT6EfV 6HMwK8t3rrmr7bGA4Rx9wy4Ocjm5iQnfdEMZsd0= X-Google-Smtp-Source: AKy350YDXGom3ChgOcAxt6iFB5mJH9jTOcrXq891A4+3filgrYDNBfv8Ea9uR1/bf5RUez4Nmb7yjQ== 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) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , Laurent Vivier , Eric Blake 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> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1681751492595100001 Content-Type: text/plain; charset="utf-8" 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=3Don 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; =20 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, E= rror **errp) s->splitwx_enabled =3D value; } =20 +static bool tcg_get_one_insn_per_tb(Object *obj, Error **errp) +{ + TCGState *s =3D 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 =3D TCG_STATE(obj); + s->one_insn_per_tb =3D value; + /* For the moment, set the global also: this changes the behaviour */ + singlestep =3D 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"); } =20 static const TypeInfo tcg_accel_type =3D { 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" =20 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 =3D optarg; } else if (!strcmp(r, "singlestep")) { - singlestep =3D 1; + opt_one_insn_per_tb =3D true; } else if (!strcmp(r, "strace")) { do_strace =3D 1; } else if (!strcmp(r, "trace")) { @@ -444,9 +445,12 @@ int main(int argc, char **argv) =20 /* init tcg before creating CPUs and to get qemu_host_page_size */ { - AccelClass *ac =3D ACCEL_GET_CLASS(current_accel()); + AccelState *accel =3D current_accel(); + AccelClass *ac =3D ACCEL_GET_CLASS(accel); =20 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 =3D 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]; =20 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) =20 static void handle_arg_singlestep(const char *arg) { - singlestep =3D 1; + opt_one_insn_per_tb =3D true; } =20 static void handle_arg_strace(const char *arg) @@ -777,9 +778,12 @@ int main(int argc, char **argv, char **envp) =20 /* init tcg before creating CPUs and to get qemu_host_page_size */ { - AccelClass *ac =3D ACCEL_GET_CLASS(current_accel()); + AccelState *accel =3D current_accel(); + AccelClass *ac =3D ACCEL_GET_CLASS(accel); =20 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 =3D 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; =20 static int has_defaults =3D 1; static int default_serial =3D 1; @@ -2220,7 +2221,19 @@ static int do_configure_accelerator(void *opaque, Qe= muOpts *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, N= ULL); + } ret =3D accel_init_machine(accel, current_machine); if (ret < 0) { if (!qtest_with_kvm || ret !=3D -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 =3D 1; + opt_one_insn_per_tb =3D true; break; case QEMU_OPTION_S: autostart =3D 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=3Don|off (enable Xen integrated Intel gr= aphics passthrough, default=3Doff)\n" " kernel-irqchip=3Don|off|split controls accelerated ir= qchip support (default=3Don)\n" " kvm-shadow-mem=3Dsize of KVM shadow MMU in bytes\n" + " one-insn-per-tb=3Don|off (one guest instruction per T= CG translation block)\n" " split-wx=3Don|off (enable TCG split w^x mapping)\n" " tb-size=3Dn (TCG translation block cache size)\n" " dirty-ring-size=3Dn (KVM dirty ring GFN count, defaul= t 0)\n" @@ -210,6 +211,12 @@ SRST ``kvm-shadow-mem=3Dsize`` Defines the size of the KVM shadow MMU. =20 + ``one-insn-per-tb=3Don|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=3Don|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 --=20 2.34.1 From nobody Sun May 19 18:49:41 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1681751501; cv=none; d=zohomail.com; s=zohoarc; b=bxLSYXh16DidPdSGIV3dfWbo8HHFqsyyFM9TX9obbc6T/NMBQbSYEANt/+CSCcp97wr++MUxNc2lZqEokUyfF/MuZfsCjsqc0bzf41cxkzd+mElnGueiLDU5VD3BKUwJNU9sn5My5C1/cmE2sppsaxn+FW7KF+rSxyp2gA+F1Ug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681751501; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=exlqhHtpNYfOagC4ag8CmHQpsGR3QrEyzrEn9wP3FGw=; b=Y0fJwGRgW4YjdjCnMikAiDR9Y2P5RBlhsuJp2W8nLSglnMpWIY7odS2u4BCdNe7Uxn/8+H6NcBl+RxVdarUfKi0Lx9AVb7IywTp/IEnl8tokEGcxXnjoszEh8Iad6rDVvoSO73fSAoW8EBEPh0nwLEQ/GFosFpjAcS95zcUmVM4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681751501573749.7886790435635; Mon, 17 Apr 2023 10:11:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poRuK-0002Ir-Oi; Mon, 17 Apr 2023 12:40:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poRuJ-0002I0-25 for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:47 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poRuH-0001Lp-Cr for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:46 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f09f954d29so16430545e9.0 for ; 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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681749644; x=1684341644; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=exlqhHtpNYfOagC4ag8CmHQpsGR3QrEyzrEn9wP3FGw=; b=ywOtLTvz2cZU98DamN+XRTh1Fgz9YnGQfz6vBBM7Ej0X9O2QM5jSxc46Vuo6Q1dGvB aklJ92UIW0Xp5AI6tS9HKKPsKXpExWyF4s7dA12LJnAmgaJpk8sUv3HvAZC5TU7t863u 6nzU190+Jo8GR5wqrYKxKySUIesZq1wu9Ex+L7I7kwQNIU2bL/+7v+5elrEsT3WFbjCV KnXu51os8c8L+T5/LGHucpaiX3hs1fWE87y6lWEOHvfO8XUIIMog1+jUgnFVw1Dt7V12 XN4meiv98uAJtAVQV4iAbm/8IgBtXKipvbzSTX3ZE8ny7/el7P2q/vWMxT/3LHgqkFkf pn4w== 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=bkHk/BAP93aMdFsfRtjBc5vYfgf0+mB1WOEZLk5pG5dxQdWjJLuPfmGrXeJmodO0nA Ce/OdFkc61jCHfDqkadufdhofs4OXdvX6MhlXqJOOw0smIDM8o47H3mGDYeIq1DmGu7v TR/DLGqf+0QcJ9lQuHUDaGD6xhHvbgbeKnXRprV/HS3ZwhN+ri4zf+RCjoRoNDNVounj AUalY8frkD1pE5lLzj/ux6ljRo4TcXBDx2xs9Ow0g73iLMjzAHYTS8qbqw4DRKo4E4qG BAERXl9UCa98ZP1VqOOfa9HCRR2U539BOUUV5IBiP6/t9iQvIbKLGmEQ08fZTHWS1um2 DpTg== X-Gm-Message-State: AAQBX9dwGSMGiNCgx8cJrAnBXfeCcB3x3fy+Dlpr2Dg/6ddp/y0n5MOt QGRsgkWl5nxCen3dxcMNXlWosk5Xk4kBDR33qF8= X-Google-Smtp-Source: AKy350bsaF1f+Lcqqll5M2lnR/askrplOHaIXPQhftt/Ll3P0i89Jz1ABcxAOo+KCtdROyNHQM/SbA== 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) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , Laurent Vivier , Eric Blake 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> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1681751503389100001 Content-Type: text/plain; charset="utf-8" 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=C3=A9 --- 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" =20 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 =3D qdict_get_try_str(qdict, "option"); + AccelState *accel =3D 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 =3D 1; + newval =3D true; } else if (!strcmp(option, "off")) { - singlestep =3D 0; + newval =3D 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); } =20 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 =3D g_malloc0(sizeof(*info)); + AccelState *accel =3D current_accel(); =20 + /* + * 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 =3D object_property_get_bool(OBJECT(accel), + "one-insn-per-tb", NULL); info->running =3D runstate_is_running(); - info->singlestep =3D singlestep; info->status =3D current_run_state; =20 return info; --=20 2.34.1 From nobody Sun May 19 18:49:41 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1681751474; cv=none; d=zohomail.com; s=zohoarc; b=DBkJHCsj/nhPKkXQOYTmgezH810KV3IruYCq9Qt1Fhdg5ytjIwJzieW/9lzwBuIyJXeWh+SyjiZURmcA+71QTKzaGCU1kInhYYHhHXG0gGVtcya9KhwViIuGqyTBJLxNFFD5kt9G2wGB9NFEpYMqg0tS+wYEwiLa0Hv9GrEvvUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681751474; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Gs+iC0C5OHKEybS9WeBQh25/t1gv+/9yrwaTYs2naWg=; b=LBmJe7BnYVLm+jRQapBrlF7ShsrtTkoaus8SDe+EtUnGlEglWi2EPm1J8trAw5e6vZKOR4sgEEWtqlIYa7jvC/53oVmbHE/HUTnb65epZUSS+9EyGWqj402SE7AcxF9tbHN5Ap2+gMQDuZLTlf+tA2CoswqypIvsLKW1Wk8nTgQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681751474761531.5978646417404; Mon, 17 Apr 2023 10:11:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poRuM-0002Jo-CC; Mon, 17 Apr 2023 12:40:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poRuK-0002IO-Av for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:48 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poRuI-0001M5-3z for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:48 -0400 Received: by mail-wm1-x32f.google.com with SMTP id n43-20020a05600c502b00b003f17466a9c1so1533228wmr.2 for ; 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:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681749645; x=1684341645; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Gs+iC0C5OHKEybS9WeBQh25/t1gv+/9yrwaTYs2naWg=; b=SOgxhaqOVTR0iErt5Cp7OmS4ImrDPTKM4/LeBNLTQib/qGq4YTey8WFslxZASR56Pc uxXyJ5X1Ugx1enmfyNsBhLotSKvbxxKplFHOHMeSQBe2MrOd9rnw08+qmTt2JfCKBXDk dNh9LndDaibxv9oKoYjm0maOlOX6PMgKUX+/BUUFnDBh5wBITGJcf2XqKZbM77POXO/o PzeoK0TntdoBPlp5LWtH8omwdZeuwbEga1mqSFtiR4M/X3dVDRQ3p3KaiUmYpj9O0InL wqINLmRp3vq2z6dKM6MbPzO/9v9XIYkGE58OuSXZetTO1Ct99JFNE5gg/+oVa2zk36ZT X9bg== 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=VCg4vaZFsV3nOai+1racu+sRej7k1SV3SS+WHs5JkT3RRRMN3Zmck5y2FrkmkGBbhZ 644/YkgQmTVHtUvlRN+iD7Q+gZ66t5M3EaWzvdToU/JDnWjbpXjr43+q0Mf7NAUlF2Ud 0hNf7Y330gtbidjhZ9cE3o9Abfxvdp6+pLmwiIA8cZS5LEfIYRdysQYTdIgHfov4kiwx 8XW4J3fMUZwyFsZbeN0+7ilfrerVI3jdL60eLbZ0EwhCqdthkz6ySVd/V6hWGoQqnWyX sZmY8GUncFdIjzRuDjA0LQmNrvjguDZw8QeAgzT5QlJAfpXK3lm46gX6SmC6CVq8q4LS oDAw== X-Gm-Message-State: AAQBX9fT4+QOnYNTn5nd5l383geBiKibsMnCbHA6nhmfmKGVOCM2/tnp BAEXlb9G5Zl21cR8FdKeDDrd6wCEEAqsu0VJKyw= X-Google-Smtp-Source: AKy350YcOdKv2EgMDxZ+OpYwt8UDkLQkTXga+4dI5oP3Wq1CqhtxkRMnYrW2JA0x3iLdS1Cuc/S+iQ== 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) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , Laurent Vivier , Eric Blake 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> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1681751476805100001 Content-Type: text/plain; charset="utf-8" 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=C3=A9 Reviewed-by: Richard Henderson --- 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 Tr= anslationBlock *tb) extern int64_t max_delay; extern int64_t max_advance; =20 +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); =20 /* vl.c */ -extern int singlestep; - void list_cpus(const char *optarg); =20 #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 |=3D CF_NO_GOTO_TB | CF_NO_GOTO_PTR | CF_SINGLE_STEP | 1; - } else if (singlestep) { + } else if (qatomic_read(&one_insn_per_tb)) { cflags |=3D CF_NO_GOTO_TB | 1; } else if (qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { cflags |=3D 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) } =20 bool mttcg_enabled; +bool one_insn_per_tb; =20 static int tcg_init_machine(MachineState *ms) { @@ -219,8 +221,8 @@ static void tcg_set_one_insn_per_tb(Object *obj, bool v= alue, Error **errp) { TCGState *s =3D TCG_STATE(obj); s->one_insn_per_tb =3D value; - /* For the moment, set the global also: this changes the behaviour */ - singlestep =3D value; + /* Set the global also: this changes the behaviour */ + qatomic_set(&one_insn_per_tb, value); } =20 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" =20 -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]; =20 -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 =3D VGA_NONE; bool vga_interface_created; Chardev *parallel_hds[MAX_PARALLEL_PORTS]; int win2k_install_hack; -int singlestep; int fd_bootchk =3D 1; int graphic_rotate; QEMUOptionRom option_rom[MAX_OPTION_ROMS]; --=20 2.34.1 From nobody Sun May 19 18:49:41 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1681751380; cv=none; d=zohomail.com; s=zohoarc; b=AFKSVvmDE9TelDyxpnTGsr/3fZH/IRveTB9/npX8KFpw3bYVUVa/V46B3TQp9YlfhNHPnNKWhILCNSDpXjcU8UHNvCDj0vSxNxIr9HJnMErWYcKMsTVyEw3TTKYopkNptMwQLFOQTaqa5a0pVSq1nb4fKEFGMTNmN7qwduZJFAc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681751380; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=p6Rq6d1Hv/zkHtdwcgnd6mnoTvLT3U0+uR+FS829PXk=; b=e0E2JmKa2zowVY5nvb5IKJWCcyLWuud+eKpPnMFmwWbIZNmSH3BC7B/3fIJ8kahU9HZuZj/SdLNK8zqZJYfFDBwZ1UWEeoXr/4Z8U4FaebCXRhYSFjohelkUHrXNVwC0k3y+EMMcYsfbK71nWL1J/8uqiJrYMcO8PeJ5lAGLSJ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681751380589969.1921137928758; Mon, 17 Apr 2023 10:09:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poRuN-0002Kb-Iy; Mon, 17 Apr 2023 12:40:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poRuK-0002IS-Eh for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:48 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poRuI-0001ME-PY for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:48 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-2f86ee42669so1625987f8f.2 for ; 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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681749645; x=1684341645; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p6Rq6d1Hv/zkHtdwcgnd6mnoTvLT3U0+uR+FS829PXk=; b=kUnsnGuOQuMOURCNSr5vyZb8ntfhk+uoD8Y9IhzxyEOVuAVkAy6zaAPKulWn8aONeA 7bQ9yCspX5Mvq61wp7GR0oq+/IhAYwxfu/x33XGIyNlANyheKaXwO+lpiGORf2YMv2pv O6NqANTUAYgKn2J0MwchaKm9mdgXkW9oaETe87iP+4edK2aW+CYanfCIX/0EVY7BBqW8 qP/c8KRd20QTDEappUITbt1gPDaUMC22sFlXwzsAPV3lz48/t584/9g+moM3Gd77858D 7a4HRrtFxvdJMlcmpK+TUfBp8g2h6PHbk9pZ61QI0Fza1m02GFPHE7Srl72gry5gvgSH JXSA== 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=Sd0cZMg7owNduGT0hpycWS2/nJwzdwDbOR3M+jilzIrfBq8YyJowDVi0td/i1ZaBz0 dOvoR07BxvSxBhfXhT6Ui1GC/xMwxn/xJ0EXLF1nEDOx3ZuJvNJK46hE4LoMkRFeN3Nc fKn+9b0ju46BmBGXBLitIIapvuG/9GDmVFHnG+TEh6mwjwDri0OygHFdL8K6ejtnDA79 hPuXmEI7GY3IZMkuxW+JgHCSY2Fhvq346asWecqRXJkjQEYYQgMIgxqn1AD4z2aUC6AQ pFwP/DHfM+cyAHCGTHzAbVN9f2Y6UtCAE9EzdG+Ump2oykoh2Zv3sE7OFDqvpKxO5zvL mB9w== X-Gm-Message-State: AAQBX9eHIgQ5KgpWYDJubqLo3KLeF2hrBSmLl19fQOVD7z75wIAB4kXz 9bB7FoUGLf8qE0c2inCPLST45kPsRj68gfj8GvE= X-Google-Smtp-Source: AKy350YsHcqybPJCRuIzB0Cyw++psKo0ZOIWDv5wU5RktE36vXAZHrbyrTNvOlhlAcBtcAwah1+ZTA== 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) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , Laurent Vivier , Eric Blake 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> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1681751383110100003 Content-Type: text/plain; charset="utf-8" The '-singlestep' option is confusing, because it doesn't actually have anything to do with single-stepping the CPU. What it does do is force TCG emulation to put one guest instruction in each TB, which can be useful in some situations. Create a new command line argument -one-insn-per-tb, so we can document that -singlestep is just a deprecated synonym for it, and eventually perhaps drop it. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Warner Losh Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 =20 +``-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. =20 Environment variables: =20 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 =3D val ? val - 1 : 0; } =20 -static void handle_arg_singlestep(const char *arg) +static void handle_arg_one_insn_per_tb(const char *arg) { opt_one_insn_per_tb =3D true; } @@ -500,8 +500,11 @@ static const struct qemu_argument arg_table[] =3D { "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, --=20 2.34.1 From nobody Sun May 19 18:49:41 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1681751139; cv=none; d=zohomail.com; s=zohoarc; b=H3OygGM1PNXxYCf32jlPjga87Zlh3zt2NL72oQWi7Y7adUExk2XmGbAwxZueBQe2aU6NusJCIjDIvghReLIb9ytHWofnfnefRLmOSJkAkZXkXxB3eYZMovz3PqL2l3b1Keo2hrhQTwLf/m3oEX0V1eFoA9qqlRdsiJFFj5kUi9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681751139; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9zh6XCv4IvteabEjdIcioL96syD6sHRMrwiuxQ8bgkY=; b=i+5SkaYTuqWj3Jzu1pumWZweMPXIHU/EBA2K6ORJQD3FbgTXZF9IxlZcrasI9fYKsGljlHQf/F1iT8M+KQz6/FUEPVYXnlw7gr3vhwCSZzIZ/wWoDUI6f4T5J9HZUSLzQVKgqJeQp5WzIJlQwL3zGhubOgcozM/r8t9kqZRFsH8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681751139105968.1786107441927; Mon, 17 Apr 2023 10:05:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poRuO-0002LB-7F; Mon, 17 Apr 2023 12:40:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poRuL-0002J7-2i for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:49 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poRuJ-0001MK-99 for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:48 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-2f95231618aso792557f8f.1 for ; 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:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681749646; x=1684341646; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9zh6XCv4IvteabEjdIcioL96syD6sHRMrwiuxQ8bgkY=; b=EkUhrN+JV1cwTljHehURUKFLzN+WuKNrB+qRRFm6mDJbgx9DKlMDh+i4fqzmPe4ek3 KVjrKYbHQ2uC0VRq4phi6+uONETSzXEiHvTyiUqs75k9+Z3XN92tF5kvdGvlH8o/rW7s LjG3NCutM/Y3p3J2SsjUTEk5lAvaKr7ZMArNuJN9y3qsKWCaAwemJP1WZu7n42bss/b9 B3IHEl5Gk+98991UFL13eHMsA62uB5wi0JL10ilffLMd2XFvShY6xyQeL9UbrjjxLSQJ 2TYGxUEUgcBMFBKN2jDBywWgX5Yn2/rZ6e0qaYV/b7XxsGP+YK41VPIT4z09+hYomWC0 oo7w== 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=ll5Hg1b/GZWxulEfsRmPfDjEA0qamax38etVkOVHbVXvs8fBmN/xsmq22D+UZYChyg q07ThXGzKLI5ypFJ586OI4+WUNWIKskTBkmQE11rP8Md+3WnPmF7sb/UqaWnHmSESeAw sRqCDfYzy+d9Tt/C0POJtqEJ9UWcBOa9GzWeQRaT3nRkZhJTYD04uxtrAvhi4AuqJoQm du/9RBgOAQWcURnnVjvgvPiTdnwwAc7vpDmmsoRAswbZkTSBrAv4InBL03zf+V/rkU1N vnBXLc5xFuAiZy7WtX6jlHuCMkXdpf0mQsZk7jvPmX3KdzqWWGidjFQMIw5ffRNUnERg 5bSw== X-Gm-Message-State: AAQBX9dYnFmg2KIsyk1t42tTsAXq386aMvIcuNF5TH6l3KzIfA/rupia XIsj+oZx4UJgaXYR6Oz+tliNOtYRmMcQJARDCDo= X-Google-Smtp-Source: AKy350ZSCvlul7ydxNf8i2U6Q1/TVebnnqnFUXR1MvNIelFMCOJXbNQyMsNepr0TRE9YXygbv7560A== 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) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , Laurent Vivier , Eric Blake 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> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1681751140914100002 Content-Type: text/plain; charset="utf-8" The '-singlestep' option is confusing, because it doesn't actually have anything to do with single-stepping the CPU. What it does do is force TCG emulation to put one guest instruction in each TB, which can be useful in some situations. Create a new command line argument -one-insn-per-tb, so we can document that -singlestep is just a deprecated synonym for it, and eventually perhaps drop it. Signed-off-by: Peter Maydell Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 =20 +``-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=3D]][,events=3D][,fi= le=3D]\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 =3D optarg; - } else if (!strcmp(r, "singlestep")) { + } else if (!strcmp(r, "singlestep") || !strcmp(r, "one-insn-per-tb= ")) { opt_one_insn_per_tb =3D true; } else if (!strcmp(r, "strace")) { do_strace =3D 1; --=20 2.34.1 From nobody Sun May 19 18:49:41 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1681751134; cv=none; d=zohomail.com; s=zohoarc; b=L/r3zOozge3vRacqAr0mkldEXcd5Qm9cu/dgwbfvbeREkgSLNQppduv1VTtnMxWEidz6hiwePSqCUz2mqMSzWNqUqPQr8Fc2ylaK3Nh9Y+kX2KHnZ7e3DqpjEFAQZ6JsVIY+n9YPXBGZJQkJH+RkiC78XlZL20us8PU8zoorvmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681751134; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5vzGB5zyqexh5lZpRKf1Wm53aoZK4fu1hbifevUF8JI=; b=NiUBjm+O/ka24hbZySTjfku/F7Hchd+rXK/KQ6a4fqLJd3Sj1kF5L1Io4uLDqIoCug76tplDEGRLaheQ0q76ZYHOM4mL5sHQXIvAvThbFpxMG7iVmwWdiTL2Xu7rwFx8e+swbwx7310WvUnhHL5/C8nsqdi9wFpXtbJAmLHP9hk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168175113465973.64559211983817; Mon, 17 Apr 2023 10:05:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poRuO-0002LC-OH; Mon, 17 Apr 2023 12:40:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poRuL-0002JS-QN for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:49 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poRuJ-0001Mg-KW for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:49 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f09f954d29so16431015e9.0 for ; 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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681749646; x=1684341646; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5vzGB5zyqexh5lZpRKf1Wm53aoZK4fu1hbifevUF8JI=; b=Cnzs/4CavDfYthDw1hlBMv+leZ3cCYcx7HPMcZEL+1iKq0MBh9aqsHlWXlVpe/JOJV GVtH16lK3xHt67v8bOgxtxylb6FXj58pQglOTAZbEK7R4OowW9CuNugWrMQ49hvHZpaZ xasuu+9lrMx9JMrwjfvxNYEJ9GWVuR9Fnjhhr92v5ka6NQu7pB6Oj/IX9NxAfacQoaU4 jOlQJe+L05IXVUnHRWffzi8ReEuGC6cgLJktscAjYoK9NHgWrhhXHlePpmre89IiwN0o ojd+ZLW+6jA+jnQWRU284cj3NlOG/uYgtsgqHWMYcHfYd7C15kiR5KUB8h5TxfXiqtWR s51g== 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=ebx2tor4aqE0o3+kqaI2GyKsGPuiuz0wsrFrk0idvWL5wKdRdFDuotADRzK5UKQd1M Ap2k835L5XteLpXw8y/oQZ78AdabR9QiB9zCI//tC1ckRLo4Z/gJ2Di6tVlnffl1JOYs E+DwZfB9fWQBSmjzRNojpAvoLj9pQuADx6RBGDEmR74oAUUen5KoJHsGwTKLEruT7mJU j6RHpz4Kc5Excm+/MGATWzoHnKK7xB89Q/NUTiw9ya9rQ5DaeFt6lYJoFZuDGimI9HgX +egngUeWg0VG8TD/EPADnZ3genLXUcYWNE/tb4FbpIShuvpdmRrg9bAIF/El+n8dYouG jaag== X-Gm-Message-State: AAQBX9epgz45KH5rL0nlHuvmlMXkBH9q33TqUGPvgnPbDsRYhAQlc+y2 Dm6VMeYnzfEV4asYCRwprZYsm/4gCyNmN5ieAas= X-Google-Smtp-Source: AKy350be5jSZOQJOPH1m5UhDLscM+4m4hCk+ImxYip+UD6KYG3cBBVCI95RQqpqvPkJntWCrP5DIPw== 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) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , Laurent Vivier , Eric Blake 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> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1681751136047100001 Content-Type: text/plain; charset="utf-8" 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=C3=A9 --- 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=3Doff`` instead. The HAXM project has been retired (see https://github.com/intel/haxm#statu= s). Use "whpx" (on Windows) or "hvf" (on macOS) instead. =20 +``-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=3Don`` 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. =20 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 =20 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=3Do= n\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 =20 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 =20 - qemu-system-i386 -d in_asm,op_opt,cpu -D /tmp/qemu.log -singlestep + qemu-system-i386 -d in_asm,op_opt,cpu -D /tmp/qemu.log -accel tcg,= one-insn-per-tb=3Don =20 once with interpreter and once without interpreter and compare the resulti= ng qemu.log files. This is also useful to see the effects of additional --=20 2.34.1 From nobody Sun May 19 18:49:41 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1681751561; cv=none; d=zohomail.com; s=zohoarc; b=J4p9Rj8F40dhYwVURzwReEj+PseH1kJviLqhkXzywd9SOAqO/AcTg+hrjlKBUrsz3/xZUXlUMR6bhM+VatZsSHpYjp9odFeC5UsRUNHFUHj6W4/IrukIK1ih+DSeMPiqXE508uT/Pu45FaNOUHGFtjQ1Qd91OU3LDy8VPTXhcDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681751561; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IUG+bykQ/Oriq02A76XvnJLKzQfmPW2xVt1eESF/Lno=; b=awMuAF3owk+uoMHxszYnr12N/1iOweE+17uRE0u9dv1RvAioyzyvy5tsr8wV6q5SlpYQw2xSa8+Fq2AXVkRvT1oEYoPLJszhT/7NaZWeEQv7UyAjueT9h5CvOzDiWfkboPqT7I4ksj7kj4OEaLkSQytXiHr5quMj2TMue4iQ+0s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681751561304282.27672824733804; Mon, 17 Apr 2023 10:12:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poRuP-0002LU-BB; Mon, 17 Apr 2023 12:40:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poRuM-0002Ja-3o for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:50 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poRuK-0001Mv-EN for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:49 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f167d0c91bso17424555e9.2 for ; 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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681749647; x=1684341647; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IUG+bykQ/Oriq02A76XvnJLKzQfmPW2xVt1eESF/Lno=; b=xQECE0s5pfvuyI7WIbnyqv1c0KixhBCx7kmChV9RagOgI92R8NbksRN/YqbGX9bpTy mo0qmJ2BhU+MedNjgpzegqhq8Qm7gk4i71AxvuGqefW8g4+JXRgzaTzi1yR7oXgtkPj3 LuGdqFadfiVtM/Shtj6KGwafd9KqcK+5ZrAS/z7vaHpv5XBV15qU9neL/jbZ/zq1bnd8 NNQxAW/WrEePUni6iXqODzDXPvVTAOHDJbNiAqvYr4Tuo2ouKUy/6He5Codz9ZkThrxd 4xhNsMY/FQf3zY5pGDe9gsJ7vVwywfZwe2w+Y2vq/Nek8oJSvZpSFj9TQVMaK4RwIOFX NxIQ== 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=PvddpFGLo3ZNy+gpR7dLkK2Tnsrt7FSlg57/udGclNey9IuIURlYWg1+FN4zsq58JA j4gVvJVO3GiQooYzDlMuM6qpCkAv3u81t5Aj3hiEaIGnlTyfU+Juocd3f9PZDxAUX0Dy IpQjuqxNA2u1/be/l6HMpOmBiky5S1ZmkWrUEDxwl60xKlbxa4kco/UEa5W3WNhKOtWG Pf59kWLNRFbfwnOxoop/AgOIvY0RvO+3wET9nAjEyfq8NG4C8GuRTJ0e4zXKjZJ0R7n3 VKOen1gbF5wRXbvMuwP0y2xZLgF9g9R715HA+YyrX7unvdo1T7NhELpiQG3ZOTqcXuZM NGag== X-Gm-Message-State: AAQBX9cjjop601rk1roC1cgYXwiafZDCQyMGHGBuzaFKY+QPHCSGIyTR zsW2AjPRC2prFi2gXny0Fk//Tvsj117RISWHZ8A= X-Google-Smtp-Source: AKy350YAWEuYJA63NMcwEdiyAIDv16VSQZ7H+ckeTJfQm0aiDW9OojY7QjUU821LYLRmiaiI0PaWgw== 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) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , Laurent Vivier , Eric Blake 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> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1681751563533100002 Content-Type: text/plain; charset="utf-8" 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=C3=A9 Reviewed-by: Richard Henderson --- 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 @@ */ =20 #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) } } =20 +static void dump_accel_info(GString *buf) +{ + AccelState *accel =3D current_accel(); + bool one_insn_per_tb =3D 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 =3D g_string_new(""); @@ -45,6 +58,7 @@ HumanReadableText *qmp_x_query_jit(Error **errp) return NULL; } =20 + dump_accel_info(buf); dump_exec_info(buf); dump_drift_info(buf); =20 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) =20 info =3D qmp_query_status(NULL); =20 - 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"); =20 if (!info->running && info->status !=3D RUN_STATE_PAUSED) { monitor_printf(mon, " (%s)", RunState_str(info->status)); --=20 2.34.1 From nobody Sun May 19 18:49:41 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1681751558; cv=none; d=zohomail.com; s=zohoarc; b=Um585ti27o1mzoNPtKB9gvK5PkonTRfVn70XnVvyL7HDolT3qEIMJ+EVYPibUDGFSrsBHGWhUfV8EacbK48NprHE15VfEIgJQowrLOE0fGhm00Yk8/46zU0uiuLzSE1hLqu5X2zu7galjYuU0HhuI+yIQwxssMyN2OCpd4NKN3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681751558; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XdrcDkwMacIqQO2KUO210mgRUqyMuFKPIP+LZZZwEDs=; b=lZBH4lD6E6k2gYl0Hrbe6r64B6ue9fMscbCZyUR3rd5jxbwXBSguwt66G4filvDwa1gZWlUR+pMV0FlCMAxBaKM/l+ZUUFIRVVOJcGaAUarzOiOr445/zXWekUmH19fssoyPnRhCcpqDYhwZcMv9g8f96uXxjULHBjZCxtoqQbM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681751558407990.8857512472371; Mon, 17 Apr 2023 10:12:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poRuP-0002LH-1K; Mon, 17 Apr 2023 12:40:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poRuN-0002Jz-3n for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:51 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poRuL-0001N6-6b for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:50 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f16ecaadd1so14616455e9.1 for ; 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681749647; x=1684341647; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XdrcDkwMacIqQO2KUO210mgRUqyMuFKPIP+LZZZwEDs=; b=RR872PwJau76BNYSBlWDk0V7M3asnkqWar+CxQUXQrDNqQLz+3OuTDDc6PmFu+W+Aa mqtwAYTP4r4SH/horCoAe953RhK8cUQwQSMSCYrTRA86lYmLEIttCtFmd+YmPe7DAXBK GAgh1P5QtotIpewadvh6yrF2ABqpERrWfeQXspZJmNV84mCSZKa4i894Y4RfHz88H7lJ bxPl+yawB8qDI0tLDP7FfEmHeq6bOhSiPJGK6Yq/leZ+as9pu8hlB9puy8tn1WuFJ2Tv dtCOvgestXemHpFtb4cr0zb27Hba8q8hrjrZE9ZOeSWAwQ2JbuOKG1Z2InpWJCsWnyVU p7wA== 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=GTTrjjurFZmawHiodejpJrYrVEvBekxqjd9No1faXEIimT70Yiiff5TmsTaKJMvZWr qG7gk1UwPrk8+7jBzfcHYYvFHUvMNYHlIx5ZfyRWgUi34iR8+PAAzAtFB7QeO13EvzYh XNVJglqn2L8+pc4xOXPnIthzVObeGMWnTHs8rVGuaalZ/yUgIIY17QJoB1fumZ+r293O T1LwnMwgsDjEjDKk8vofSCEazh4NmVut6oqHm+/kFMsGl/fWN2upRLVqOKTCND+YQy5B /mc1KxdTZ8aeS2nj0Bq3MZ8dFQJX5/hWvaOgrkvsAGwiZFuMtoe0XqYvHBcVns8AqScF R9yA== X-Gm-Message-State: AAQBX9eiBPHRxPK8NeE/hRnVvOS5ncWZl2tkf99XaFBpormF9rnY9HEd +sWqO0+fCCjZ9QtRrm54PW1cjV9G55bUxhPMzdU= X-Google-Smtp-Source: AKy350bIUQ2PccjuA47BsiSgfjOr0WnlJLusJ50iYjJOtaOkCJgkSw5b5Xk+IJmVZxTT8HzFD4AYrQ== 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) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , Laurent Vivier , Eric Blake 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> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1681751559793100003 Content-Type: text/plain; charset="utf-8" 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=C3=A9 --- docs/about/deprecated.rst | 9 +++++++++ include/monitor/hmp.h | 2 +- softmmu/runstate-hmp-cmds.c | 2 +- tests/qtest/test-hmp.c | 1 + hmp-commands.hx | 25 +++++++++++++++++++++---- 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 3c62671dac1..6f5e689aa45 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -199,6 +199,15 @@ accepted incorrect commands will return an error. User= s should make sure that all arguments passed to ``device_add`` are consistent with the documented property types. =20 +Human Monitor Protocol (HMP) commands +------------------------------------- + +``singlestep`` (since 8.1) +'''''''''''''''''''''''''' + +The ``singlestep`` command has been replaced by the ``one-insn-per-tb`` +command, which has the same behaviour but a less misleading name. + Host Architectures ------------------ =20 diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index fdb69b7f9ca..13f9a2dedb8 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -158,7 +158,7 @@ void hmp_info_vcpu_dirty_limit(Monitor *mon, const QDic= t *qdict); void hmp_human_readable_text_helper(Monitor *mon, HumanReadableText *(*qmp_handler)(Erro= r **)); void hmp_info_stats(Monitor *mon, const QDict *qdict); -void hmp_singlestep(Monitor *mon, const QDict *qdict); +void hmp_one_insn_per_tb(Monitor *mon, const QDict *qdict); void hmp_watchdog_action(Monitor *mon, const QDict *qdict); void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict); void hmp_info_capture(Monitor *mon, const QDict *qdict); diff --git a/softmmu/runstate-hmp-cmds.c b/softmmu/runstate-hmp-cmds.c index 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); } =20 -void hmp_singlestep(Monitor *mon, const QDict *qdict) +void hmp_one_insn_per_tb(Monitor *mon, const QDict *qdict) { const char *option =3D qdict_get_try_str(qdict, "option"); AccelState *accel =3D current_accel(); diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c index b4a920df898..6704be239be 100644 --- a/tests/qtest/test-hmp.c +++ b/tests/qtest/test-hmp.c @@ -56,6 +56,7 @@ static const char *hmp_cmds[] =3D { "o /w 0 0x1234", "object_add memory-backend-ram,id=3Dmem1,size=3D256M", "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 =20 + { + .name =3D "one-insn-per-tb", + .args_type =3D "option:s?", + .params =3D "[on|off]", + .help =3D "run emulation with one guest instruction per tran= slation block", + .cmd =3D hmp_one_insn_per_tb, + }, + +SRST +``one-insn-per-tb [off]`` + Run the emulation with one guest instruction per translation block. + This slows down emulation a lot, but can be useful in some situations, + such as when trying to analyse the logs produced by the ``-d`` option. + This only has an effect when using TCG, not with KVM or other accelerato= rs. + + If called with option off, the emulation returns to normal mode. +ERST + { .name =3D "singlestep", .args_type =3D "option:s?", .params =3D "[on|off]", - .help =3D "run emulation in singlestep mode or switch to nor= mal mode", - .cmd =3D hmp_singlestep, + .help =3D "deprecated synonym for one-insn-per-tb", + .cmd =3D hmp_one_insn_per_tb, }, =20 SRST ``singlestep [off]`` - Run the emulation in single step mode. - If called with option off, the emulation returns to normal mode. + This is a deprecated synonym for the one-insn-per-tb command. ERST =20 { --=20 2.34.1 From nobody Sun May 19 18:49:41 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1681751572; cv=none; d=zohomail.com; s=zohoarc; b=X93zMnB7kYfhlNYJB2csEu8iPD8i8Ufw++JIY2SItxZIUwhuRstt/S/kB96//p8x66dVaSlhCAgW57L8RkqGjRAFuVG1BY/Hk62yLfZwXQdIHM9DboQGL3P1S/fxAC3Clpo+TJALFnuIeuIhus79vUocPRWCZlcjP9PbSYfF1ps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681751572; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9/0TyOdhBrDuhL5XsvOLjbBITyKIzOif+YMbpV7tsp0=; b=ZW8l0USco7AXam51gA+jduD1fSe9QkqdtPH0vKzTJS81KbR0hnpDDC3os+ZWOQoioPpmVO0b9/lggxLmUtBUEznSwbBFBiJlu8xlDbPiFDRIlpgj1R3QXUmTmPnstjh4DDAKUxyud8M0j5uMWRIrOKU/cm00zqp+qpJxDYcg/Iw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681751572234564.1166082855476; Mon, 17 Apr 2023 10:12:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poRuP-0002LW-JZ; Mon, 17 Apr 2023 12:40:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poRuN-0002K0-4b for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:51 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poRuL-0001NQ-LW for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:50 -0400 Received: by mail-wm1-x330.google.com with SMTP id gw13so14135947wmb.3 for ; Mon, 17 Apr 2023 09:40:49 -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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681749648; x=1684341648; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9/0TyOdhBrDuhL5XsvOLjbBITyKIzOif+YMbpV7tsp0=; b=kAlj5jqI0dAAXVWDiiK9X0L5c8FVL/8w/3V5yWyc5MslJ4Xkv+gTFIN4Ul5mnuZgpG Q2h66MH9BY0h5tGV55YVVS1e1oFxFbWAB+cB2t40f5D6NWlwuaPMuKU6WzoBr6SIdJa3 2jQnDTgq7LRxZhjgXaHm2PcIWJPvr9AEK5gS0e7Szrdanpjw95yCF8eCR+RXa+2B/33Z fiVHLHOPaJnQgS1nUw4z5xz8JnDRS6aS1Fs6w8YMbYbjjt5hdlO5BaOAk284D5QbkVeT cS435lFE5XLRPliP69yK7z/GOmFgyjdufZlbEKhrM69+n11Kv1dBwQ6FeKwrKLNNb3sG P3Pg== 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=MsR3GFGe7H2cxd4T9crhNpCSg7zBdLSClFL/oaeTmX9PMkO8wBSdNa0wl9FoDv9xoz 5zdh1sMxkulUh/FEJpqXkwODiy2pl8FXOE0o0yhTw4CwjOwZuv8GJrvTsiDmsHMzYcJS vnRzx6+4vFJ5QQgBaqQpgQKvCHAjBwoH2HxUIutJM3KQ7tT08xrG8iWo4k3PYKK2FnsB Bd2ECh+vKBRmDUym48w9FTjXYFvyWAViwmU+Vbgmn+pwqvallOUK5IWiMVsdFYOjkdYc AJAfa8fCLFRnjgglqBxmqJJiP99KdhC1sqp4SNA4v+i4R76KXVb18XhsiKii0Mvv/k/P 31BA== X-Gm-Message-State: AAQBX9f7lwbTku6jq/N4sG2VRuZ7cjAgfzRteQ1zZsBfJBNZE53wQ4mg LejcBfTBWTiUQ4ODv7ayc76ew0831UJyKujPu8E= X-Google-Smtp-Source: AKy350YiOQ+PocfvZd1X28ZO3eJ7OxJR9fyuE53JmkIhzFNnB76Rc4qEB2sSjVvdQ3ETfd2IZl4wtA== 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) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , Laurent Vivier , Eric Blake 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> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1681751573529100003 Content-Type: text/plain; charset="utf-8" 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=C3=A9 --- 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' ] } --=20 2.34.1 From nobody Sun May 19 18:49:41 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1681751163; cv=none; d=zohomail.com; s=zohoarc; b=XZRvHV38f/srgLIpIj/XF8vQ08DroRpR1NOBATCcv2j121Qkvz2wqEubgtfBSUU/z9/56qAE/Oq/U1+8CxzoNf4GaRF+FfNVjx/P3DtT2QME5W4C4rBfcP3FuCR0c95Hw6C7lnchGbvDUdskjaWJEwoUb5UeKzhL24eyFqoDWvs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681751163; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4B6l8UECJ90CPUbM7Klpck4y118EN0eBNxzC139Z/3k=; b=Yz4Ei9mid9PuBEmw95SrUqHQ3jfpqWPd+dPlKH0rDrp6w8MLbJj+jEGPWORbLChlXL2YCH10CDFNG5FsgVY/1FjOqKz//oXqMORpzLhrrKBL5+DUigumMzoOgp90+o/aCJGp9+CBLvxQmhWhPPxMNMy4+z1u4JPXpA8HqRaxjEo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1681751163472494.2801729953128; Mon, 17 Apr 2023 10:06:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poRuS-0002Mk-JD; Mon, 17 Apr 2023 12:40:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poRuQ-0002M4-Ng for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:54 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poRuM-0001NZ-1e for qemu-devel@nongnu.org; Mon, 17 Apr 2023 12:40:54 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f0a80b683fso17869095e9.3 for ; Mon, 17 Apr 2023 09:40:49 -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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681749648; x=1684341648; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4B6l8UECJ90CPUbM7Klpck4y118EN0eBNxzC139Z/3k=; b=If2UGM2x/eZvTfTZMAiUpd0v+VkHctVYZhUMg4zEVeAqPMUpYWyER+VwwkgBiiJMwz roEGzJQXJsk2557IWJB2rp/jjzEx1ekQ+3+v0j97iKazGB1NprvhDWGVMLW/wwJZNKTF ZNE0WPyvzeGiBtEsorI57XJXymXeautCtZ+tY1lt2oicw4WNz1HGEWsb/JmkBrTspbXN YZVM5//IRSif/H/hl2cIeAD/Dw+acDrggMlxjSDvAUyj/YF4S2vfe4fZVDDpxBoKZEpG S+/SvqRlnQlZFbCVB/Gc8AiJ6wpyubknirdROkYxzVlb325I9PkIQK+iXkyuS/ffQiH0 k2sQ== 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=fmfQUZh4Rv2q+7kgxkiM3jI52BWA5IV+Eyn8di3lHukYV0eGqAPi+49SeANeu7ygMO 84Js+TYV//EboZB/Alh0MP/sTF3oMO07qiM/6v4Q3TEPa8COZhbl58K9Y9bzj/mUEhyL 3tY0xqbCvA9RTr0MDMk6D4fRZaBL8TM6/axVmOF2AVyTiXea55qvbOiCe3JYUxT/dTbk scCuwhgLfaMkKan8APKSt4CVVdlXP/TdMkivFckA8pDigiTKMa3CLJeCk7KM25g6oE9E TVZ4Fx0VKxO/71VodS08zbORoXHXj8/6vCsvISSi4s4Y0H8G1mo+izMldLFbDydpsrsW BEJA== X-Gm-Message-State: AAQBX9eDwzgo73Goug0DIiZlRsgnETycSptD4Wk+299kdAR9FmXKyz1l jkn/1divLdORctIlywSmSKohskYF31t056ShpOc= X-Google-Smtp-Source: AKy350Y37xr+bENfG9mOJznO1VgNCOjSvPo81D7ySH5JUZ1yLVtZYYOQPqeNic6Qh4lbPgIEhCt7OQ== 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) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , Laurent Vivier , Eric Blake 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> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1681751165526100001 Content-Type: text/plain; charset="utf-8" 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=C3=A9 Reviewed-by: Richard Henderson --- 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. User= s should make sure that all arguments passed to ``device_add`` are consistent with the documented property types. =20 +``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 ------------------------------------- =20 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=3Don', 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'} } =20 ## # @query-status: --=20 2.34.1