From nobody Sun May 19 11:23:10 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=1680533236; cv=none; d=zohomail.com; s=zohoarc; b=en19/lvsaTmKuEg3P4nTtn/xtTZoKb3n8eSbjAyz8tezNk+t55883ZZqElpiv12+yMsG7fkdhUHoxnn38chyk7Y1zhZDmkenTTQVHDEnpC2Nu9z+mybCAb9Ri1zutwNPYDm3z5NMUoSyD980bIXN+l1QP5CE7SmHRDwbleAQSXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680533236; 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=UJID9GmOx2jzlUGH47d3z9T6Y9jGm7kH5S4i27q1feA=; b=lzUjgLMkMwxm31RGZihXonBj4aAJkOnMoiXv/OZhWZCPAgK0sH182EL5W4kBc3lsO+7Q380OELmDUfHoW3seanOf8fkrSET2MHbnMJqdNQOQlCkPmanmcANjiAzanrzNU6+SvDMZM6qSAqWOpcKBNgxz9DEoaB8aZfJtcf311Qw= 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 1680533236031274.8886258450942; Mon, 3 Apr 2023 07:47:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjLSP-0003rJ-EO; Mon, 03 Apr 2023 10:46: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 1pjLSJ-0003pp-VL for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:48 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjLSE-00019x-1O for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:44 -0400 Received: by mail-wm1-x332.google.com with SMTP id v6-20020a05600c470600b003f034269c96so8046468wmo.4 for ; Mon, 03 Apr 2023 07:46:41 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p4-20020a056000018400b002c56013c07fsm9786747wrx.109.2023.04.03.07.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680533200; 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=UJID9GmOx2jzlUGH47d3z9T6Y9jGm7kH5S4i27q1feA=; b=ZweuE9X0v0LXgeeK2GapNuwo/UM1o6uZQBgTsDeiWHrnZmoa4KmZawRORJgghJYLnc 2njtq/Cei8fN/8tFrvEaB5btiSjAyWO87XPx67AL7ETsJ6Nqm/kSI0kJnFD+pg789kSy iUS3YrJrGG3K2o4TDhJ31lX7fODdSloNJD2g+GiW8R6qfPvFBw3z0HrYjx9OwB3lL9lJ Ux+36BBA2KH1W9kEfKmx0NfISdQs8kwnbz/0y2rWml5qEjaUAsNHGbdkDsV+1pY2F8/d BLtHDF1EMBlDd3rKPnBYI9j8U2rPAxP/Fb1EqoZg+jIgnR8JHQqNMyWVAiK+PVtTi9is ay1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680533200; 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=UJID9GmOx2jzlUGH47d3z9T6Y9jGm7kH5S4i27q1feA=; b=ongyVlU9PM7T6X5WCf/9b5cXSgfrYY2QCQgHwm9Ewas/3PRnQBkO/za2Y7YeFiOc4l v0LY6fwvFaDsVrYmYot0Njzo8Ui6q/lgUrWR1VjmJE7GAKT0rMxcJZtVaZjdcIqr7xyA cnEqkmsoFdvqN+aFEWyCqE7vPQu9BRHc3TIFsvCkGsHAG9PMYQdwX8SNrXvo16Z0T21s o6Ym4lUa3SwVU3SdfccpesfJ2iSIKWVFRQLUCfnKB6q9XnkUQsZzxX+44/M8OnlHvH+I UlqqqDLyJKurV82+QCZyTZBoEtME60Hi/i7LGfaT82pYw+BHgjjLayvscjOIM2Qj0GKr 2wBg== X-Gm-Message-State: AO0yUKULPv6fe+8h/nabzjkZDf0sVo5IIs8UVFm+8TmsXdEPSYiHoqnR NEMjhpW9AMERt1iNH6IE602SS9tOuvp6HVAbd3U= X-Google-Smtp-Source: AK7set9KDD8tN1VBsX/GUzDuTxJfCdcywmrMsdFsnzsPimP6m/hpnsw3K0e99ZsORsT75JS0/vLKcg== X-Received: by 2002:a1c:7303:0:b0:3ed:e715:1784 with SMTP id d3-20020a1c7303000000b003ede7151784mr28264824wmb.15.1680533200013; Mon, 03 Apr 2023 07:46:40 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , "Dr. David Alan Gilbert" , Laurent Vivier , Eric Blake Subject: [PATCH v2 01/10] make one-insn-per-tb an accel option Date: Mon, 3 Apr 2023 15:46:28 +0100 Message-Id: <20230403144637.2949366-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403144637.2949366-1-peter.maydell@linaro.org> References: <20230403144637.2949366-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::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1680533238138100008 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 11:23:10 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=1680533307; cv=none; d=zohomail.com; s=zohoarc; b=dC2pAbQKOvGovi6cPuR0F0Ia+zXL+6DejAN1kn/Ao27Jdfu6uP5NVyrxwLWGcbVpXacMFwWB4EnJZ+KraizRU0PAz2zXpFpeA6thjX4e3fvcags+6xnnySq+Za6TCTZbXiq9IP7kvHLAF8zDewveFb0Nx7ewH9VhPbKaoUgQc+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680533307; 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=YO9m3UJpoeAUuVfDe6PY7fBDGyKIbPa3OPAs5QubE+o=; b=cGzrCAMWwp1MdSAtvOmSWKfQ7ZtkpeC/1FlbDgJTY7n0WMw4trygdWk2g4JbCpQCPaxHar0D/1yu6cBFopud5NJUsnnH6gvGooxHIlf/LQJKk4cvWzDjJVN3Mqa1RsvOcnikKuK3vbF+qFyss3FOJpW3Z7o3chxzaHCTyZ23jVY= 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 168053330726396.34913273323775; Mon, 3 Apr 2023 07:48:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjLSS-0003sE-0b; Mon, 03 Apr 2023 10:46: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 1pjLSK-0003pt-UQ for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:49 -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 1pjLSE-0001A2-QY for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:48 -0400 Received: by mail-wm1-x32f.google.com with SMTP id l10-20020a05600c1d0a00b003f04bd3691eso3386441wms.5 for ; Mon, 03 Apr 2023 07:46:41 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p4-20020a056000018400b002c56013c07fsm9786747wrx.109.2023.04.03.07.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680533200; 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=YO9m3UJpoeAUuVfDe6PY7fBDGyKIbPa3OPAs5QubE+o=; b=seAGP8d4KRnOPTUqCSng1fZszaI9Uj1OZhhPS7Dmz5UHLTv/QL462tyYmMSO/8PUrl DEIzd+sfDkX75fJ7ZrwFXxVwrO7I5w1pJnyBfDn7HIXLMVL5UkE1fzUbjdAewbbw9p3+ j/p5NVY5ATXSHvelnkixIfoEatzt+NIG2gvkczXeYoDAIC6DqYfq/Tshqia5LOzqGk/1 5or4hVLiRVRkSU6PLT7JG7ngDnu7ldiURCkecwacluys4WLG49b79g7gr7Ay55tZzAnW NxNotc7SM7P9RP4GoiUTuZQjL5GZNhY2A9EyargVfUtLIcUs5Lhi4cMy8dmeFMid01oA p2aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680533200; 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=YO9m3UJpoeAUuVfDe6PY7fBDGyKIbPa3OPAs5QubE+o=; b=yx3OeNQrTHtNni9OR++CqiLakHGwOQk08oCOj74RqJa0LoxPnXKvgPoeP/i45T18Ja +aeGVwnrAKKW/staog88S0Ta/ftGRIdJOCLI9pp+bL3YG7t3MUJG5dLCySjxN75mlNE3 ewjaJyS6U0ffjbYzP+wlwXX+8VbiPfQKlFd/2YSv9AQty2A9NsSB46Hp6qFOj3P+LxXR x7rm8YxgG/SX+deVI1ajlyFAqaS0dGG3qje+v3/72iTJRbQgBqdHsWCtk7oqAij0xxGB aZAG6tyLUzOWiGcRzf96+SNZudha7q0qHoDPQ4NnpMdiuV/tkqHSmk1sY2QS+NM2tK1U A8GQ== X-Gm-Message-State: AAQBX9e8Ls6GaTetVfVekPiygVg0ReJ6ysxek+ERr/pkFXZmz4BGljQ1 i2KcnIvUhQZb1ILIDXfvwFOjXDRn3u3ukgfCRzU= X-Google-Smtp-Source: AKy350bkO2dKg6ZrQ6P8gIh9/YokYPzUF0zjaWhJFegR+Y3jdSZkO+ZNWBlVCGcuSTYmMiCTQ9ybNA== X-Received: by 2002:a7b:c7cb:0:b0:3ed:5d41:f998 with SMTP id z11-20020a7bc7cb000000b003ed5d41f998mr14325423wmk.15.1680533200589; Mon, 03 Apr 2023 07:46:40 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , "Dr. David Alan Gilbert" , Laurent Vivier , Eric Blake Subject: [PATCH v2 02/10] softmmu: Don't use 'singlestep' global in QMP and HMP commands Date: Mon, 3 Apr 2023 15:46:29 +0100 Message-Id: <20230403144637.2949366-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403144637.2949366-1-peter.maydell@linaro.org> References: <20230403144637.2949366-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 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: 1680533308093100005 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 --- 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 11:23:10 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=1680533316; cv=none; d=zohomail.com; s=zohoarc; b=DdWpjKDpC0sxUIfh5jhJ6jWWLO83X+g4AvWe85yr2rt1AKrFK3iltbMbvP4LWN5Jv2yfkOGLnGfA5csW3Wdy6hoZ85yGUF6haxxjGb5vnOiKtS0vVcf0vOTCkmAt1nQ54nU1U16Zx+VDRneJfDJEJMsUQ8eeyOYVWxOFuokk3ls= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680533316; 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=6Ioe7i1XhPEIgWa/90riLiQcGkz8VafNKw9E/yIfRNU=; b=VQ1QUt7uCROh0m9h71kn6Fp3xWr7ge0ozXpeMcjTtgZbbj33RdG0+VQ4gV0gBc3l7/KIwtVkCJUhWgd8dlsdKGtaaZ5ExgTw5TfrNo7MCmhQXM+SAYaYluwzmg6cxIT9dguZng/HhrdUHU4Vi0PsWx3jiU/y5lw1dFqooyQezqE= 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 1680533316231774.6800695326712; Mon, 3 Apr 2023 07:48:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjLST-0003tj-VA; Mon, 03 Apr 2023 10:46:57 -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 1pjLSL-0003qE-NL for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:49 -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 1pjLSI-0001AB-Am for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:49 -0400 Received: by mail-wm1-x32e.google.com with SMTP id o24-20020a05600c511800b003ef59905f26so18250631wms.2 for ; Mon, 03 Apr 2023 07:46:42 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p4-20020a056000018400b002c56013c07fsm9786747wrx.109.2023.04.03.07.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680533201; 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=6Ioe7i1XhPEIgWa/90riLiQcGkz8VafNKw9E/yIfRNU=; b=pKB4oH7XnUK/z5pDpSRl7d0CU7mi8qRjxsVkhD6Z96hh5Bq3DnzBZkFMDLsxFMwXA7 FuE0yFP5DOTVxmKBGiyrPFWBwCsJOLf8dmhLgI0k/Lh8dQDDrf7CY9vLLAcfND6yRoDM z9RAhLM8ZFM2lVyaa6RiWDFaSackqxlKuW+NjCwf974sXpYtoQnw+1ICsrQXby1/EuZc 1RRz1OZtwYtdiVtCi4g+lNrmBocWEbXmsEP8lNWM7tQQDK1upOO9OjFfFa7GnXFsgw8N xzTNk/4EtDGzyeKaAhlhrnoD2PGPPMpxFhWVeK725PChYk624WY4DzBosFSuNr3sPx58 n6jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680533201; 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=6Ioe7i1XhPEIgWa/90riLiQcGkz8VafNKw9E/yIfRNU=; b=xmdwyH9MnLydPIOXTnaRSvj1fqzczQUWSUwQrtHiC02NKLSSsViUMtm/DGxWOL+L7U lHKzSLoHE9R2wrQ9hr0G6xQPyeuduQXyUuu4dwe1VvMkOATHCoulpE/rUVUGFYQvxTBk WlYw9MUAwnFxdEuKxsSDyn2PnPAxHGMmipk2n9ZDwysSpF/LGDwGS7+AdxO2lbiSn/nF KhLID4VFuLmXIWQtCXi3KcxYzrFGslGuyRd1Yo1oikrAsshlfZXMe8SUbIaxyGb9psfH etviCFoPO3mw8Iqpcw54gPqQMmd3FHY5VjcClkGHMxD/vC8SveN5LDQwgiy3/gTgNrMU 8LPg== X-Gm-Message-State: AO0yUKViHzX981UV0Ufxz6nte00r9YNMN73ZJOcUicemYIiDi0qx2jvV XdkWtIMpgHq14ZSEi7+8IjnCVt5MZuAQbghXgcM= X-Google-Smtp-Source: AK7set8lbwcmzo5JVhpCyds7XlWC/sJf+6pLXR2d3wPBtfrOmynZ7kfdBioNbKU487+oazhJz7oA1w== X-Received: by 2002:a7b:c8c4:0:b0:3ed:b590:96e6 with SMTP id f4-20020a7bc8c4000000b003edb59096e6mr26557827wml.4.1680533201188; Mon, 03 Apr 2023 07:46:41 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , "Dr. David Alan Gilbert" , Laurent Vivier , Eric Blake Subject: [PATCH v2 03/10] tcg: Use one-insn-per-tb accelerator property in curr_cflags() Date: Mon, 3 Apr 2023 15:46:30 +0100 Message-Id: <20230403144637.2949366-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403144637.2949366-1-peter.maydell@linaro.org> References: <20230403144637.2949366-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 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: 1680533318407100001 Content-Type: text/plain; charset="utf-8" Change curr_cflags() to look at the one-insn-per-tb accelerator property instead of the old singlestep global variable. Since this is the final remaining use of the global, we can delete it entirely. Signed-off-by: Peter Maydell --- This is the "clean" way of doing it. I dunno how much of a hot path curr_cflags is; if it's really critical we could have a global that's private to accel/tcg/internals.h I guess. --- accel/tcg/internal.h | 16 ++++++++++++++++ include/exec/cpu-common.h | 3 --- accel/tcg/cpu-exec.c | 5 +++-- accel/tcg/tcg-all.c | 17 ----------------- bsd-user/main.c | 1 - linux-user/main.c | 1 - softmmu/globals.c | 1 - 7 files changed, 19 insertions(+), 25 deletions(-) diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index 96f198b28b4..6ea5f7a295f 100644 --- a/accel/tcg/internal.h +++ b/accel/tcg/internal.h @@ -10,6 +10,22 @@ #define ACCEL_TCG_INTERNAL_H =20 #include "exec/exec-all.h" +#include "qemu/accel.h" + +struct TCGState { + AccelState parent_obj; + + bool mttcg_enabled; + bool one_insn_per_tb; + int splitwx_enabled; + unsigned long tb_size; +}; +typedef struct TCGState TCGState; + +#define TYPE_TCG_ACCEL ACCEL_CLASS_NAME("tcg") + +DECLARE_INSTANCE_CHECKER(TCGState, TCG_STATE, + TYPE_TCG_ACCEL) =20 /* * Access to the various translations structures need to be serialised diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 6feaa40ca7b..609a29a5dc2 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -162,9 +162,6 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t star= t, size_t length); 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 c815f2dbfdf..1ed3878b6b7 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -149,17 +149,18 @@ static void init_delay_params(SyncClocks *sc, const C= PUState *cpu) uint32_t curr_cflags(CPUState *cpu) { uint32_t cflags =3D cpu->tcg_cflags; + TCGState *tcgstate =3D TCG_STATE(current_accel()); =20 /* * Record gdb single-step. We should be exiting the TB by raising * EXCP_DEBUG, but to simplify other tests, disable chaining too. * - * For singlestep and -d nochain, suppress goto_tb so that + * For one-insn-per-tb and -d nochain, suppress goto_tb so that * we can log -d cpu,exec after every TB. */ if (unlikely(cpu->singlestep_enabled)) { cflags |=3D CF_NO_GOTO_TB | CF_NO_GOTO_PTR | CF_SINGLE_STEP | 1; - } else if (singlestep) { + } else if (tcgstate->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..7c4f9f34d39 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -38,21 +38,6 @@ #endif #include "internal.h" =20 -struct TCGState { - AccelState parent_obj; - - bool mttcg_enabled; - bool one_insn_per_tb; - int splitwx_enabled; - unsigned long tb_size; -}; -typedef struct TCGState TCGState; - -#define TYPE_TCG_ACCEL ACCEL_CLASS_NAME("tcg") - -DECLARE_INSTANCE_CHECKER(TCGState, TCG_STATE, - TYPE_TCG_ACCEL) - /* * We default to false if we know other options have been enabled * which are currently incompatible with MTTCG. Otherwise when each @@ -219,8 +204,6 @@ 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; } =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 11:23:10 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=1680533252; cv=none; d=zohomail.com; s=zohoarc; b=HYG7djReif5UcaoHxPn3PF/t3dYaLkn6idlpvsFiunYgxExXRtQ6E9NZHp/aIKBRlQHmefp2McZdkp3pW2EDgbWo4kaEjbt+0VKT/mnH0cQ0a85nvkCRebBz3l54Vl0LtPrfCV8KIsG3Qws531jFk0bRqQluGiACMyHXxol4NfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680533252; 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=IM5IsuhD9SWzbJFvTVd/5A+kw5NS2zU/+ji41aVhTPA=; b=lKE1kZo9WOEoNkS2ONOu3fjmbeEzK5M/T9At4USxp3MebP8CsKFnvwLfgTBltrJV2MNUJzbDj7gDxd3IrDSbqQbVkd7OtRpnOuGW5wZ0e6SwOgkT5XGYftVSqvxhbUeE2p13PsVQC7oHQk77f8ZqT9ZKtVapXlKyEL0Izn8XZFA= 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 1680533252548125.8529666494984; Mon, 3 Apr 2023 07:47:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjLSX-0003uJ-62; Mon, 03 Apr 2023 10:47:01 -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 1pjLSM-0003qg-66 for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:50 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjLSJ-0001AE-MZ for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:49 -0400 Received: by mail-wm1-x334.google.com with SMTP id n19so17286884wms.0 for ; Mon, 03 Apr 2023 07:46:42 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p4-20020a056000018400b002c56013c07fsm9786747wrx.109.2023.04.03.07.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680533201; 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=IM5IsuhD9SWzbJFvTVd/5A+kw5NS2zU/+ji41aVhTPA=; b=GJo+lWOK5EC+L1Q52nA7EBpDQg+4w0ri284Yl8v7S6H+Z6CEd4v8uFlX72GXAgvOMX RcXsJpHxVrij9GEEfQKj5S+si2X+uf6l5+wc44OCbPj+o8BT7s+5sO55QM595cjR3ycJ BKJyM72bJRXHFjYKoRSa5MLhRz03XXQawk2uLD+A1fkOyLWmpOiAMvCZ6A/w0gBNegcs wPf5Fsg1/O8b8D/K2hVinufJwLfS4T+V6ra9xzDMsQieGsvc9djIPGRMaw8umLUmW3+C JAhyzisgNLl3Qh0yg8tuReaD3n0KTQaZRN4QwZvnAjRLTR0Qn3mWK6P3qqdnWZRI5w+G ME5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680533201; 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=IM5IsuhD9SWzbJFvTVd/5A+kw5NS2zU/+ji41aVhTPA=; b=w2dXJzl1ltWAcF5viQObwJ+1NTtbQSA1/dW5gkqIMzLfhzVeCYXeM78W1aTVPQsEBq QYAW3S+0MgsWP4GIktuCo1+GhNb3ztEvx4uT09OgPU/Awf6vADGGtaSxlTWBaOU+5SvA 03NcuRY8HGrBA8JbtOsR8duk8KX+lL/QTMlf4Kw5X/vL0XmAfXFf8ZVWCz6EThOqbj0p EAZ5sCytjQfxKBOoP8G1P82aqzDRDq/YC/sKQ8Oj+BkvAtptm8ZsenzKIqSyVcyTgTBc NSE85CUzDyS/4ndAYDRvx30N5bQH5nowddccKs1CiY5Bw8GifGZa+1kUCCkCDBh3dhLn sZ8g== X-Gm-Message-State: AO0yUKUFnF6931dIQLHXIyHeRl10YC9+q2yUJZ6vf6F8ZRruLZA78HBz bqH8lxD3qkgQ2sNx+QxtwKzxioC8UaQ2oI46dOo= X-Google-Smtp-Source: AK7set8bAtbo09K8nwTSw25qFbAuWGClvp45GbAIrqYEEwdKHeeoNypdZ89BiRyEN6JbDdULXJop0A== X-Received: by 2002:a05:600c:21d8:b0:3ee:5d1d:6c2d with SMTP id x24-20020a05600c21d800b003ee5d1d6c2dmr25667055wmj.35.1680533201775; Mon, 03 Apr 2023 07:46:41 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , "Dr. David Alan Gilbert" , Laurent Vivier , Eric Blake Subject: [PATCH v2 04/10] linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' Date: Mon, 3 Apr 2023 15:46:31 +0100 Message-Id: <20230403144637.2949366-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403144637.2949366-1-peter.maydell@linaro.org> References: <20230403144637.2949366-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::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1680533253910100002 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 --- 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 11:23:10 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=1680533322; cv=none; d=zohomail.com; s=zohoarc; b=LX3qzSGXYrB0rcL3iDd3pfb8oGAtM5Pj17oGV9IkyJW3BpZzZa4vx/IzxCZNaa17CsJy0Z3wtdWeoPuGmGkOTXzvAbac0AKzaycy96lBBBPjs4n/2/wYt9mITcUpMcmezwX2KdgNEM24ItyQTqvDgbVDOVWpiQVRBicCGsrd0Vg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680533322; 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=ytKjnDvRMIcS4Sr4naIJJlunrHtq0dhvkTa6XH1ctRc=; b=HbnGR4PUAO8GEm4WDVJPArWJ6HdgrrgFqJW4NAHUfnPktqZ2Jc314AoOfQu44Xi77ErFcRCQC4ZCFniWcmvjN9Mui0DTTSqcu5i46MYYDU6OZFuhZPUlOncJYvoLE0kSC208tnEw/l7NBza40GCy2juzzGNHsMcG46VA1Tij634= 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 1680533322191342.81966438389895; Mon, 3 Apr 2023 07:48:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjLSR-0003rj-7d; Mon, 03 Apr 2023 10:46:55 -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 1pjLSL-0003qD-LW for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46: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 1pjLSJ-0001AK-0h for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:49 -0400 Received: by mail-wm1-x335.google.com with SMTP id n19so17286903wms.0 for ; Mon, 03 Apr 2023 07:46:43 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p4-20020a056000018400b002c56013c07fsm9786747wrx.109.2023.04.03.07.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680533202; 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=ytKjnDvRMIcS4Sr4naIJJlunrHtq0dhvkTa6XH1ctRc=; b=LTVnL2XRCSFExyuGXBgG3MFp7L+ilc6vw7DcmBZLVw//qjEsSrU6btOlKD6/G66T1l d5GGAibt4eSdgd3HKmvpemnM9ycqlgRPbihpRs2mA0B+wCGT2rJDWAsR2/OfythVyHNv PmBwlGGvoGU8bkki5HRW+s29c1cS4PJS9hv9O47SqZM4zfLlhxkCSH5G5rZ2R1JklagX iqBwl4s2oGkx0NcFyO2+Rn7CEpRwCysO1VlOFir4Yc5qqIB4q3/84EoU+AiX307U0M/Z 5F1WJwN5R2zRMkhT+z+HoeuxnFdytU4KNoNFj6ggZOgTBrqVvU1gwspP3VIhTGFevZnr he9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680533202; 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=ytKjnDvRMIcS4Sr4naIJJlunrHtq0dhvkTa6XH1ctRc=; b=m3gZVEl9YhQAiD+kWMhS13iRKcbA+3zW2vQLK3IsM39TJhs5I8HFp9MSRzPHKC0Xj1 qGgwbWo2f7tADUBNP09TzdWesRIfmCCDwf+UwntZUhGMlUDNeSJCr4o1fo7MertNx7dE 8Skxabr0MenosWs3o6Y9TCdN7mFtDrVrF6UDjtFFE6uDQa0BzG2rEjV6KQGTXWF+3l2j RBvmRexfZqU1IdgbyUabRPSSVt8M9RTBswuE29QpGf7uCRH2W0Z2rbjbYw3dFYAV56+Q 5+6UZsUT9lvwF5qYpmxSjcolOWr+c73kZd25fGNhSiA0b1Rc5qKocAMF5OFBvqBD2mal 9jkA== X-Gm-Message-State: AAQBX9cjtcdCSpm36R4ETvCE2pgyBz44zzRjO2JNTLlxk6LkQXee/NEq nkEyqKMIN82DPaH1yPVE96an+zDA2jXfRzSXX0U= X-Google-Smtp-Source: AKy350Yp7N8ogtuOZqiTAGunYQd+s39ZLj4ezT4aE+khT8n3+CJADjOaMjL0REsly8SuMQXGEw+agQ== X-Received: by 2002:a1c:ed15:0:b0:3f0:39ab:347c with SMTP id l21-20020a1ced15000000b003f039ab347cmr10847848wmh.23.1680533202308; Mon, 03 Apr 2023 07:46:42 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , "Dr. David Alan Gilbert" , Laurent Vivier , Eric Blake Subject: [PATCH v2 05/10] bsd-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' Date: Mon, 3 Apr 2023 15:46:32 +0100 Message-Id: <20230403144637.2949366-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403144637.2949366-1-peter.maydell@linaro.org> References: <20230403144637.2949366-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 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: 1680533322408100003 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 --- NB: not even compile tested! --- 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..9d604a670b7 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 11:23:10 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=1680533236; cv=none; d=zohomail.com; s=zohoarc; b=MXJf84lm2rhxWQrmCERafNWy46jlQnvPtN61lRHqbNihCGL2rH99knBX33K+R3gggPP8dOq2gm7YBsFff81kTAXNB4XN3GHQJTQTsYlhqaXwEU4q76Jw4ipCfu8cCjbwPb7Pb/LbM/YmRxqGgiY6PL886IS0P21lvfY6mfKvAg0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680533236; 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=tOMQqYczbQzJT4cpOfgtd59pSmpxm7+Vtg1FH5cDagc=; b=X3BLLzTWXIldjw0LLx5UzlwcXggkOes00yTl7TBNdlJE1ihbRlaqyhpro/jAH1DYPVfZl2B/RMEbksGMOyYgGoKATSlwVwRhp7zs6ILHQAzsd1/XVcQb5AYoJxATGryfyE7gZFGJZsbqKSfQLIP0Cob+ZbtBm7kj7uBA7Tpi7tQ= 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 168053323620654.9574292818337; Mon, 3 Apr 2023 07:47:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjLSS-0003sg-BP; Mon, 03 Apr 2023 10:46: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 1pjLSN-0003rI-O6 for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:53 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjLSJ-0001AO-P8 for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:51 -0400 Received: by mail-wm1-x336.google.com with SMTP id s13so17256048wmr.4 for ; Mon, 03 Apr 2023 07:46:44 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p4-20020a056000018400b002c56013c07fsm9786747wrx.109.2023.04.03.07.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680533203; 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=tOMQqYczbQzJT4cpOfgtd59pSmpxm7+Vtg1FH5cDagc=; b=N/GkXXgLNwP1pVBVS4lLVbtrzB3qKXJ0Ql8zn67MdylWVnGz2Up8fKOPaydMeWux2U Tr9xWJqm3sR4bQzqIMSwWWBg5elzwh6RTNgZ8GJXFjQN2zrfAK9QY9lX1624GYVwonEt awHsBD014OZuYKebcjT8x0YvRqGOH59FqGOq4SyoP3oj8dEMVx2y8qPSG83qzR99tcEw Q9j42B3NHYpvnk7yzMHw/6MevBNjsg4NESSjZBniSHBMP7Ctx5dwXoyQvukf9Xskm/AT Y3z+2byUfAnRq8U6SrWlAqDfiDRteu5c2HIfGaJfnFLN0UJC9CYq9dHth980c8erYD7j fyBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680533203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tOMQqYczbQzJT4cpOfgtd59pSmpxm7+Vtg1FH5cDagc=; b=M8fOAYhAD0rGOdELVpP1JmHR+ZzhhWNpVfPUxeYSITskURt3qqDHwkPUjHq3YQvE3n dy6vLbI6A5APQCtcZNmO/ZXvs6SkTH9HKpihHLFD5EjAzSsu8FYqtk/YPZxk23gqbOzj GFflFqu6WtX9oiXCKUC3yy/r752/VmDDWmJf0RQBkwlGddAM1sTQIQe/sC90ygO6mW9o iEFfxZZIgmZDtKNZMH+iikCuRgvcDXItO6LUyY+3vnYC0rlWDDNy4xPJ2dIdcEDUH3WP E8pd8LWpOY97FRDGTvkm7+ob0FHjIhYJdHTLicGD91mUzORC/S1tJa4f8IYgNHgb9hAj /JJA== X-Gm-Message-State: AO0yUKVJ95VJ5K9U/bHGRaBNb/ZEX2ec4Mebi1L1KkjenQC9UNLC7E+c +8q6aamLKbypk8oC0crx48MNNhqTRyp6Ht+YSo4= X-Google-Smtp-Source: AK7set8NcGIJAUD5f36RHhgV7Ky9UxQeFrXMEE5BLtDHABZNNw+mNXeZQbTiZWacVrj4KtJvhLpS5A== X-Received: by 2002:a7b:ce16:0:b0:3ed:9b20:c7c1 with SMTP id m22-20020a7bce16000000b003ed9b20c7c1mr24843697wmc.20.1680533202768; Mon, 03 Apr 2023 07:46:42 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , "Dr. David Alan Gilbert" , Laurent Vivier , Eric Blake Subject: [PATCH v2 06/10] Document that -singlestep command line option is deprecated Date: Mon, 3 Apr 2023 15:46:33 +0100 Message-Id: <20230403144637.2949366-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403144637.2949366-1-peter.maydell@linaro.org> References: <20230403144637.2949366-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::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1680533237847100002 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 --- 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 11:23:10 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=1680533329; cv=none; d=zohomail.com; s=zohoarc; b=Nj07v2Zk4k4MPZSgYblTLx5SMnXvV3tghUL4gIpgCh92BlVXDY1kQdSn6Q9aBLkRUyFmkS7z/PDiIsbleka5gozKQt7sFun/kENUJbSnnbWzjUpjFO3L78rWDgLp0KcKAv/8bBjQ450tD2/K2hY6DE3tBOY/PjgqfN8zjmwqgJY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680533329; 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=3epTQBYW6Jzl8bhA8JL/NwcO0wptisWs4DJRdCAPoII=; b=ddZKhRWl13i3NDqpZpt4fcBVG0XBojUi/b3zYuWu6R9RPDhhoBThxIDOKZIMhRiLIvlLsvl/ImzhN2BlggCrWcTbIsld26h5+3hvvi4I4AVP3qLBBjh5dhUykuySh9mhyR/NGNy+gglpcQG7SPgPLS8TWU0kAyVYV6OXoLEGdrE= 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 1680533329848990.7767236691528; Mon, 3 Apr 2023 07:48:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjLSa-0003uw-Fb; Mon, 03 Apr 2023 10:47:04 -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 1pjLSM-0003qj-II for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:50 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjLSJ-0001AS-Og for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:50 -0400 Received: by mail-wm1-x334.google.com with SMTP id l10-20020a05600c1d0a00b003f04bd3691eso3386532wms.5 for ; Mon, 03 Apr 2023 07:46:44 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p4-20020a056000018400b002c56013c07fsm9786747wrx.109.2023.04.03.07.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680533203; 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=3epTQBYW6Jzl8bhA8JL/NwcO0wptisWs4DJRdCAPoII=; b=AlbMeKsScGDONiGb/vOejVPMuGqUv8apX5hpFUCt4RXTLIKcQpyQIPCoYpGnu8nNLf rjXRxm3rPs2cqBYL2x3RCQBUX/2Nzdkh/Rb4JCL5bwqBf1xe4YtGBQZmIRRB1pfvJlz8 p9PO9bWNNPBEPXcWCZ2aEYCjA+E/ZPwB2+T3K5EybFdJ/t+sM/HbEh8qKf+LWbEY5DBB hHdXxiSYIHtZox2c31BxM5KR55fpDQLr7Ro3e4BJLS9eusYjYvI3PuBE/s66rpcjjNt1 2vChk31H3t+fZlRxisXQspv5yY6tEbj0395L/zT43/jdqajUTl4vd75vLKtgRLpoSi4M 4Xqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680533203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3epTQBYW6Jzl8bhA8JL/NwcO0wptisWs4DJRdCAPoII=; b=ZPs/n84fwz8yWqHnScfz0tb+BNI6Ca1A5qjGQmL4SSVXrwDoZC0bN4ZqWVxtdVYjJo zv3mHfq35VP6O/G2AL+J3RH50IaMI8HVVAEebBPAwcrUaDSRb5Jce8jj03OIhYn636Z1 W6uozzUPZMLqsUF6Xhen8U6woM20V08Oy4uIwXxxncQJJbB5YD7xtMp/yZ3uQ8FkTdHM llXNixwyGKZ3tGPuqRtD8KwHsFpt4tzlMnOFLSx8Rj5l03B8AG63Ngbt2LhRepfDhoZT RrffmVKcNwGWT7X/ujw+XnQCaeHcIIf/HsWBTCnXAbdyhTfxK1CAt2wyIa0pMrenWK31 fgcw== X-Gm-Message-State: AO0yUKWok8n1+5jFyLtAJ/w7QD+CGda9rk+BVi8nhwW5e+e0wDxn+Qog 4DXf2YY/H2b4LseGzIZWmzNPGlgRA4+GTugayRg= X-Google-Smtp-Source: AK7set+xP3gfF+j8oxnNRd3t5FXyXZVPfyeg0UVQHEZEGl49R6I4Vn4aApCXnzJCw7ZRQc+CODZHJw== X-Received: by 2002:a1c:4b07:0:b0:3eb:2b88:a69a with SMTP id y7-20020a1c4b07000000b003eb2b88a69amr27060975wma.14.1680533203364; Mon, 03 Apr 2023 07:46:43 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , "Dr. David Alan Gilbert" , Laurent Vivier , Eric Blake Subject: [PATCH v2 07/10] hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep' Date: Mon, 3 Apr 2023 15:46:34 +0100 Message-Id: <20230403144637.2949366-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403144637.2949366-1-peter.maydell@linaro.org> References: <20230403144637.2949366-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::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1680533330445100003 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 --- docs/about/deprecated.rst | 9 +++++++++ include/monitor/hmp.h | 2 +- softmmu/runstate-hmp-cmds.c | 2 +- tests/qtest/test-hmp.c | 1 + hmp-commands.hx | 25 +++++++++++++++++++++---- 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 3c62671dac1..6f5e689aa45 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -199,6 +199,15 @@ accepted incorrect commands will return an error. User= s should make sure that all arguments passed to ``device_add`` are consistent with the documented property types. =20 +Human Monitor Protocol (HMP) commands +------------------------------------- + +``singlestep`` (since 8.1) +'''''''''''''''''''''''''' + +The ``singlestep`` command has been replaced by the ``one-insn-per-tb`` +command, which has the same behaviour but a less misleading name. + Host Architectures ------------------ =20 diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index fdb69b7f9ca..13f9a2dedb8 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -158,7 +158,7 @@ void hmp_info_vcpu_dirty_limit(Monitor *mon, const QDic= t *qdict); void hmp_human_readable_text_helper(Monitor *mon, HumanReadableText *(*qmp_handler)(Erro= r **)); void hmp_info_stats(Monitor *mon, const QDict *qdict); -void hmp_singlestep(Monitor *mon, const QDict *qdict); +void hmp_one_insn_per_tb(Monitor *mon, const QDict *qdict); void hmp_watchdog_action(Monitor *mon, const QDict *qdict); void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict); void hmp_info_capture(Monitor *mon, const QDict *qdict); diff --git a/softmmu/runstate-hmp-cmds.c b/softmmu/runstate-hmp-cmds.c index 127521a483a..76d1399ed85 100644 --- a/softmmu/runstate-hmp-cmds.c +++ b/softmmu/runstate-hmp-cmds.c @@ -41,7 +41,7 @@ void hmp_info_status(Monitor *mon, const QDict *qdict) qapi_free_StatusInfo(info); } =20 -void hmp_singlestep(Monitor *mon, const QDict *qdict) +void hmp_one_insn_per_tb(Monitor *mon, const QDict *qdict) { const char *option =3D qdict_get_try_str(qdict, "option"); AccelState *accel =3D current_accel(); diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c index b4a920df898..cb3530df722 100644 --- a/tests/qtest/test-hmp.c +++ b/tests/qtest/test-hmp.c @@ -64,6 +64,7 @@ static const char *hmp_cmds[] =3D { "screendump /dev/null", "sendkey x", "singlestep on", + "one-insn-per-tb on", "wavcapture /dev/null", "stopcapture 0", "sum 0 512", diff --git a/hmp-commands.hx b/hmp-commands.hx index bb85ee1d267..9afbb54a515 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -378,18 +378,35 @@ SRST only *tag* as parameter. ERST =20 + { + .name =3D "one-insn-per-tb", + .args_type =3D "option:s?", + .params =3D "[on|off]", + .help =3D "run emulation with one guest instruction per tran= slation block", + .cmd =3D hmp_one_insn_per_tb, + }, + +SRST +``one-insn-per-tb [off]`` + Run the emulation with one guest instruction per translation block. + This slows down emulation a lot, but can be useful in some situations, + such as when trying to analyse the logs produced by the ``-d`` option. + This only has an effect when using TCG, not with KVM or other accelerato= rs. + + If called with option off, the emulation returns to normal mode. +ERST + { .name =3D "singlestep", .args_type =3D "option:s?", .params =3D "[on|off]", - .help =3D "run emulation in singlestep mode or switch to nor= mal mode", - .cmd =3D hmp_singlestep, + .help =3D "deprecated synonym for one-insn-per-tb", + .cmd =3D hmp_one_insn_per_tb, }, =20 SRST ``singlestep [off]`` - Run the emulation in single step mode. - If called with option off, the emulation returns to normal mode. + This is a deprecated synonym for the one-insn-per-tb command. ERST =20 { --=20 2.34.1 From nobody Sun May 19 11:23:10 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=1680533262; cv=none; d=zohomail.com; s=zohoarc; b=Mg5LBeB0RMgteI540GA9Zqn6DrfBncaOjSikn2hGCbo1P7MBHVDqwzKq9+gnAXqWWqquCXpa+2ylgIDWGxEUbiyh86x9jvM7phcn4YX59zsENXVpHoNDc9G5PW1jLAC402x7euCSW7kTA/s24t0Lq7zoQvs7e/Gwrg7kh55mB10= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680533262; 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=VidZ338/Ll675LpmUIMXQVVwfttOYy1vFb692uMsJIU=; b=gYcs7b2DO36S+SrKJsmcrxfXBUOXIAA9z1EaEJa9QRwreXY7mbYcO3BTojqmCOdU4FwJ8BEWhNcO/yL1VOpcY4fBf2WpZOfXcdls4rGfqr65Y3GQtEM7gj1odKgOPPFU09IOYLCK5TV0Pd/5g09+0oGPpofHlNDdU7krakY3Ous= 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 1680533262827851.1763280086253; Mon, 3 Apr 2023 07:47:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjLSR-0003s6-RT; Mon, 03 Apr 2023 10:46:55 -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 1pjLSN-0003r0-0f for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:51 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjLSJ-0001AX-On for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:50 -0400 Received: by mail-wm1-x331.google.com with SMTP id d11-20020a05600c3acb00b003ef6e6754c5so14569038wms.5 for ; Mon, 03 Apr 2023 07:46:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p4-20020a056000018400b002c56013c07fsm9786747wrx.109.2023.04.03.07.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680533204; 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=VidZ338/Ll675LpmUIMXQVVwfttOYy1vFb692uMsJIU=; b=WEZHtHCadaQla3wo+MneEsv+quPH235LaPthExJHIuEDd1IvVcyyFd+Rf15cT8cPLx Kgx1yfWNGyJC7sGROHpMGY9KTe0lWxd3cqMTZWOGhJHaPpbAZVW0TD4BCJlDfs/wppVf zQHkSgPET5HwgrB3iVjslpWYe3kd9/FdwK8fvFP69Vqw37pGTK6e30z4YJ4hmZCiXsYl ruCyvwup0oR30pdjxXBUfHpeixLYKENz+do+v+tQo2XupeL+Sbh2Bo10TVUw8YELIDF4 oYWlBu16X9gLP5qn3rLd9GROt7cJnDmGMCJ1KXISepZ6imf8oFLZ2uw0m68QR+Nubvok edkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680533204; 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=VidZ338/Ll675LpmUIMXQVVwfttOYy1vFb692uMsJIU=; b=aacIYqPZ+jXgZVnaT0ev+U+z8T1tWF4tzz6vI5p1b+LQqSZG7rnwe93NSMQFpJX3Mf /jjSti4vmd9VL2Djff6joDbcrK8lFptrYStwvKzNQm8Ro6z4eBnNioXpywstW7XS4kXS kcK1zElSqeaTnTRBJ0mZJBxu0Tid+5OlCnrcN5g9JVBI4hpp6Cl68r29vBEY6b3x7OGJ uLXyqnj8eix1adFz9vG7M1a1WdtbI5PKLnWOdGRr+rSiPQwBpXjqptlVCw1hpAbaKCQ5 d+qidY8KQpdhnwgq9KR0B8Xk998/b4KqEZdwQM4SrTl0S79O+JMYjIsIOomZX4Iwt8XQ pz0A== X-Gm-Message-State: AO0yUKVQebGUhpQJzfsdG0OD4ciZ0y/82vFjRJPVwT5OkD1AP/ixtuDk GCQLndlWOSXfX+8iZAnn0NBMru/+PcmH5jX4Tp0= X-Google-Smtp-Source: AK7set+XuyLboAp+32/dhEjcLqLhEeLc+K4XotaEDXfOysGthZD31DiueNK7IjB8rFh9/rPjNS+uGA== X-Received: by 2002:a7b:c44a:0:b0:3ef:8b0:dbb1 with SMTP id l10-20020a7bc44a000000b003ef08b0dbb1mr26691138wmi.7.1680533203939; Mon, 03 Apr 2023 07:46:43 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , "Dr. David Alan Gilbert" , Laurent Vivier , Eric Blake Subject: [PATCH v2 08/10] hmp: Report 'one-insn-per-tb', not 'single step mode', in 'info status' output Date: Mon, 3 Apr 2023 15:46:35 +0100 Message-Id: <20230403144637.2949366-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403144637.2949366-1-peter.maydell@linaro.org> References: <20230403144637.2949366-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::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1680533264552100002 Content-Type: text/plain; charset="utf-8" The HMP 'info status' output includes "(single step mode)" when we are running with TCG one-insn-per-tb enabled. Change this text to "(one insn per TB)" to match the new command line option names. We don't need to have a deprecation/transition plan for this, because we make no guarantees about stability of HMP output. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- softmmu/runstate-hmp-cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softmmu/runstate-hmp-cmds.c b/softmmu/runstate-hmp-cmds.c index 76d1399ed85..20facb055f0 100644 --- a/softmmu/runstate-hmp-cmds.c +++ b/softmmu/runstate-hmp-cmds.c @@ -30,7 +30,7 @@ void hmp_info_status(Monitor *mon, const QDict *qdict) =20 monitor_printf(mon, "VM status: %s%s", info->running ? "running" : "paused", - info->singlestep ? " (single step mode)" : ""); + info->singlestep ? " (one insn per TB)" : ""); =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 11:23:10 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=1680533283; cv=none; d=zohomail.com; s=zohoarc; b=YZMDU9Geq+adt2IJgIgrvSdpuStrgazOBQRNtuvruCnHO1g68pEcGmn1fC90MzCmHryoFQDhZK8+CwWRT2fx4jsa+k75+3qjb+L24txUtyrVAWBtAym0Q7sX3k/UTaVhWxQfX0WMuto8QF/PQdCoiISe+mXwueY7EEDtYUa1L40= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680533283; 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=LArqj9VknOgkBTyyuZYG07qAUGjDeEnsQCmGlUFbOUA=; b=VFIl5t/1O3UJWzESiFrNJ7HYUZl0f8rmHtT1X63hS2/FS6OySUBFavOMyH952QJYD3cj1MOEzwi6II+ImP+eLTsMueKEgmwa9dVE33vaM4ylcOaJKleyuHujp+ufqpxqiRki5LNdWO2WgrFpVUeOFBt9QZmENti7drw1koINYTU= 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 1680533283286254.35749603411057; Mon, 3 Apr 2023 07:48:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjLST-0003tU-OC; Mon, 03 Apr 2023 10:46:57 -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 1pjLSN-0003rB-Hy for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:53 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjLSK-0001Ab-Bx for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:51 -0400 Received: by mail-wr1-x42e.google.com with SMTP id h17so29612124wrt.8 for ; Mon, 03 Apr 2023 07:46:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p4-20020a056000018400b002c56013c07fsm9786747wrx.109.2023.04.03.07.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:46:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680533204; 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=LArqj9VknOgkBTyyuZYG07qAUGjDeEnsQCmGlUFbOUA=; b=A2TzxACFJnrY4WLj6EcX7+S/Jn4raH69LlL24IDU/qGSCsS3bIBrU1EKVt3xXzrIJT iHjTLzemQHTLaPyWgB2FyZ316WLhFD/RbMCQAeG0dcUyCZuQboKMWzrQynhaUO/cOTsC drIDdG5Fvi0XhZ/cKv+A8dgM7OHXzWOa+qZ7ogKaZFLCT+cMS+TxlMYw3fNFRJnqoTYA bQslCl5PdK1+ZOjkt9WuJhyNWEXJWqtumv8GJZGdFtfnl4NYLiMgWjnRTxJkjlG9Cc2W q65TI6pnsHE6BtQCQjzEEto27NJZMs8Nkf4a0bbWUQf63XcUmtnPNmPfvAchv17wNGF7 3SsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680533204; 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=LArqj9VknOgkBTyyuZYG07qAUGjDeEnsQCmGlUFbOUA=; b=ZM9z5aPN5aU7VqkQR0HdhBW039aEgaWUwys1XO+AO2Syq4ClzeuCnK5GVM3JKRbRqP KrhB60CoJBaHSGqWLB3siiaJnxoRWDiNRcm87bkQc2tF0MTlavysPHUvsGEBSVqdLf9e oouqKJchzL8Cx0Zn9P6uPro6n+Pi1wLHIc+kejGJnewDtxYvhMlhaxbrsGsBELruuJr2 Pkw0nD7dHUqs1jutHNFZyR8XlY4ooivUwwCw/ZruZq7QbHVMQ01FZ8y1zMwHu8V6sA57 kx+YcIjd5NtrNHkgh97ZMbEzK0y2ZCHXn+Swfu81ETBP5/LmpOBI3IQHBxRBxGR9wSdP H3mA== X-Gm-Message-State: AAQBX9d3rocgB/8pw0cygW7PhfXNN2bwiIjFlMgTUDIlCt7ef0uCBbmS wgJo01mxWr+QeRqydYqCgVR+3XbgF6cnJhQbAj8= X-Google-Smtp-Source: AKy350Z6VXOQ0RgqPg/boF5Sjtq6Pt+rs4OfnScG3tuX4u32Q7QpDuSVBOEAqeA4yd82V0QCaFuJsg== X-Received: by 2002:adf:d08a:0:b0:2d4:99f:6701 with SMTP id y10-20020adfd08a000000b002d4099f6701mr24919882wrh.58.1680533204517; Mon, 03 Apr 2023 07:46:44 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , "Dr. David Alan Gilbert" , Laurent Vivier , Eric Blake Subject: [PATCH v2 09/10] qapi/run-state.json: Fix missing newline at end of file Date: Mon, 3 Apr 2023 15:46:36 +0100 Message-Id: <20230403144637.2949366-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403144637.2949366-1-peter.maydell@linaro.org> References: <20230403144637.2949366-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::42e; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1680533284093100002 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 --- 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 11:23:10 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=1680533303; cv=none; d=zohomail.com; s=zohoarc; b=ivaOevrZ+zhcqnLg4s9TBEGedGMBrtOIhVyekT2xCWChqBSi0NjOM+Rjobu/GS5fik8DBVSEBU2kO7ysSXRFGF2hq6LMx6KbSQkxwK43VNVhKewjU0WjbrSG235lDzhkqz8wWyrjf5hmDkHPG6XiqjW7IPncBxyZrVl+ZmsgvUc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680533303; 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=4jK6aPnvhoLlQ8Sv74zAHKAsy82lPEcHA6DLIZvbg24=; b=iS6YRzGLc69t0pmugyi6u6RxaQQTES6XPrCTS964iiSGVsWKtuo2M4qBG4Uny6CtFOXrmzQ1kHlYiWIH4zShFKYSiR5nYD6HfZn/VneUm56vTvXucizoVgrJpaRSTvpFMDJMY2CaONYZXSc21+skDOKBJIxwxI1S0+F0Kz+mkIA= 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 1680533303729645.3224357370847; Mon, 3 Apr 2023 07:48:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjLST-0003tQ-HR; Mon, 03 Apr 2023 10:46:57 -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 1pjLSN-0003r1-78 for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:51 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjLSJ-0001Ah-OI for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:50 -0400 Received: by mail-wr1-x42b.google.com with SMTP id i9so29634053wrp.3 for ; Mon, 03 Apr 2023 07:46:46 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p4-20020a056000018400b002c56013c07fsm9786747wrx.109.2023.04.03.07.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:46:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680533205; 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=4jK6aPnvhoLlQ8Sv74zAHKAsy82lPEcHA6DLIZvbg24=; b=BEfE6BNm71DFP8VVZHyHGsapIj2CJ0tY5hkapng3u4kT8/t4AlgJtwskhJQqLhQgol 8ujXM1mS2FEebstCTedd8itoYRkqAA402UEnH/Hq1utAS4RyqFrI4QMOHATzlnTBl2TS OrrUZRbcWNv+XhoucK52PSZ2OlHVFZmhNlr+PVSM8TrKX5hsv+/43I8rmHM9yzLs0zVO hIr8Kg1QvR9SUJSRxGt6RHoRsAcXusy79/tSJ0T6dRKUitruhm2XlLah9PfswAqjaeRF xh4y0XcWLyiaTZdNzaXvwPByn+dKqhK19vo1LGR2E03oxLLGdNGq0jRc/O2ch79QZhyj SvFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680533205; 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=4jK6aPnvhoLlQ8Sv74zAHKAsy82lPEcHA6DLIZvbg24=; b=5UkAUZJC1QSXL0mYUy65v4fUn6kMG2ErzCVSeI14UdmeO2C3W5fLqaSU1A19zVl2mP p/YkWBC2mVMVJpwPo+VQsSwC8XAZLsA7qOIo2x+RXyk1kUhTXCoL/AkuHqORAQnhYNLq NAUGdczJdOKoEfiE9p4X2ea/W9YX8BCqst92CPbV/k0sNzWrGabXXBuWa0WO5miJJQAu y3YrPNaraDRw7d+KSFQ3UD3/7ngSIlS2Ua9RETc/eDmpjD+aahqkB+wBipYOAIOhhpdU Wsu5xxb2K4PaMnaIKbBpSDqcUvHbCOORAI97b3iUW4UxaWnKzRh+YcwMHS4wbfcFEzAX wcLA== X-Gm-Message-State: AAQBX9fiyLzVq/kPTkTCMDXs8hMg5aLnbNz0djq5qaU4YkKOIpIhWvef sQbZs8+HSOMALxnL0LJj14xSDm0TaAbFLxpj1S0= X-Google-Smtp-Source: AKy350agU63LEuzy3saVlgDrzb3SaZt0LZsMsGqM8HQP7fHqgRl44bRKK8hvTLqf5CwXHkqWKoAUPQ== X-Received: by 2002:adf:fccc:0:b0:2cf:e868:f789 with SMTP id f12-20020adffccc000000b002cfe868f789mr26405539wrs.48.1680533205070; Mon, 03 Apr 2023 07:46:45 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , "Dr. David Alan Gilbert" , Laurent Vivier , Eric Blake Subject: [PATCH v2 10/10] hmp: Deprecate 'singlestep' member of StatusInfo Date: Mon, 3 Apr 2023 15:46:37 +0100 Message-Id: <20230403144637.2949366-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403144637.2949366-1-peter.maydell@linaro.org> References: <20230403144637.2949366-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::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1680533304890100001 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. Create a new 'one-insn-per-tb' member whose name matches what the field actually does and the new command line options. Deprecate the old 'singlestep' field. Signed-off-by: Peter Maydell --- docs/about/deprecated.rst | 10 ++++++++++ docs/interop/qmp-intro.txt | 1 + qapi/run-state.json | 17 ++++++++++++++--- softmmu/runstate-hmp-cmds.c | 2 +- softmmu/runstate.c | 6 ++++-- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 6f5e689aa45..dd36becdf3b 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -199,6 +199,16 @@ 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, because its name +is confusing and it never did what the documentation claimed +or what its name suggests. Use the ``one-insn-per-tb`` +member instead, which reports the same information the old +``singlestep`` member did but under a clearer name. + Human Monitor Protocol (HMP) commands ------------------------------------- =20 diff --git a/docs/interop/qmp-intro.txt b/docs/interop/qmp-intro.txt index 1c745a7af04..b22916b23df 100644 --- a/docs/interop/qmp-intro.txt +++ b/docs/interop/qmp-intro.txt @@ -73,6 +73,7 @@ Escape character is '^]'. { "execute": "query-status" } { "return": { + "one-insn-per-tb": false, "status": "prelaunch",=20 "singlestep": false,=20 "running": false diff --git a/qapi/run-state.json b/qapi/run-state.json index 9d34afa39e0..1de8c5c55d0 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -104,16 +104,27 @@ # # @running: true if all VCPUs are runnable, false if not runnable # -# @singlestep: true if VCPUs are in single-step mode +# @one-insn-per-tb: true if using TCG with one guest instruction +# per translation block +# +# @singlestep: deprecated synonym for @one-insn-per-tb # # @status: the virtual machine @RunState # +# Features: +# @deprecated: Member 'singlestep' is deprecated. Use @one-insn-per-tb ins= tead. +# # Since: 0.14 # -# Notes: @singlestep is enabled through the GDB stub +# Notes: @one-insn-per-tb 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' ]}, + 'one-insn-per-tb': 'bool', + 'status': 'RunState'} } =20 ## # @query-status: diff --git a/softmmu/runstate-hmp-cmds.c b/softmmu/runstate-hmp-cmds.c index 20facb055f0..404d331b523 100644 --- a/softmmu/runstate-hmp-cmds.c +++ b/softmmu/runstate-hmp-cmds.c @@ -30,7 +30,7 @@ void hmp_info_status(Monitor *mon, const QDict *qdict) =20 monitor_printf(mon, "VM status: %s%s", info->running ? "running" : "paused", - info->singlestep ? " (one insn per TB)" : ""); + info->one_insn_per_tb ? " (one insn per TB)" : ""); =20 if (!info->running && info->status !=3D RUN_STATE_PAUSED) { monitor_printf(mon, " (%s)", RunState_str(info->status)); diff --git a/softmmu/runstate.c b/softmmu/runstate.c index 2f2396c819e..a93e74c41ca 100644 --- a/softmmu/runstate.c +++ b/softmmu/runstate.c @@ -239,11 +239,13 @@ StatusInfo *qmp_query_status(Error **errp) =20 /* * We ignore errors, which will happen if the accelerator - * is not TCG. "singlestep" is meaningless for other accelerators, + * is not TCG. "one-insn-per-tb" 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), + info->one_insn_per_tb =3D object_property_get_bool(OBJECT(accel), "one-insn-per-tb", NULL); + /* Deprecated member with same meaning as one-insn-per-tb */ + info->singlestep =3D info->one_insn_per_tb; info->running =3D runstate_is_running(); info->status =3D current_run_state; =20 --=20 2.34.1