From patchwork Mon Feb 6 17:13:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 650949 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp2393697pva; Mon, 6 Feb 2023 09:15:45 -0800 (PST) X-Google-Smtp-Source: AK7set/yyll3aoJYHTY8kLLL1bk6IZapZvuxBSmZ+BXS++0AECkM1A82YkuyWnyhtX90icrCLZp8 X-Received: by 2002:a05:622a:611:b0:3b8:5057:3776 with SMTP id z17-20020a05622a061100b003b850573776mr170905qta.13.1675703744880; Mon, 06 Feb 2023 09:15:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675703744; cv=none; d=google.com; s=arc-20160816; b=IYY/FEaaMSR0CaVd6uZ2WoBSt1Kz2M7TautMQoQCizY90sXGs4szSsv+c9XfzSbtHo o6HbMxaNKHFklyfKtb0GBuou+HXx7OwhxSiX3wAqrJZNBUxcqApkBnKX4/3692CGVeie 8t+oSn31Zcz7W6b/vi7gOXhOQGv3zXHtqjNci6xJHUt5i/EtEDVo6XRnX/MijBpMPRVB 0NUSJ5N/nOgNuW+p3FSqoJ6DVsAvFtMY8KqD4oOIOegHx/2QNu30ahbKKE5rOtN2z/Cn pYxeeLL3ya6Wu+NFadwsYF6BOGujEUcKHv/lLmvIrLGCKhJTwBUD0MW1WQreIoqjZqp4 tSHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=Yj1DEvs3X4/BfrWA87uKCI4tHJLA6vEN8CkLaerxWYk=; b=BLdPkHh4Q8e3tf+fMGK/eZkkuu5uRPh7tdxZFdLUkq5ghIpzBx3BUC2PaY1nqStj21 jAvtXRXuVEAANvIqGzYj/3vA5TYOU/ZWRr8EMaWP0YLyglDSMfj9BRqyTzyfGsJM+dfb LgCOqxfiOkObSaXnjm8eCRFq8QME+twLmbnQDGX+dQqpHAhcYEDbFPnIZSXHtSvrG4pr ig9xBfUD96m3X3V9PzZR3PDNgqjbfZI4X0T6oNr1HxbXG1vUg/EoNh2lURlJiSWuMCTn ZGOe3RGAzmPpMS0m8m3EJ2m1KA+4F8L9/usfjIMQ5xW4DgapwIjk6ztM3HW1xSYc573v dlYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uN+LE8QH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v18-20020a05622a145200b003adad7a9d50si7872030qtx.628.2023.02.06.09.15.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Feb 2023 09:15:44 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uN+LE8QH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP54I-0000iV-66; Mon, 06 Feb 2023 12:14:14 -0500 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 1pP54D-0000hV-8U for qemu-devel@nongnu.org; Mon, 06 Feb 2023 12:14:10 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP54A-0001QK-0Q for qemu-devel@nongnu.org; Mon, 06 Feb 2023 12:14:08 -0500 Received: by mail-wr1-x42f.google.com with SMTP id j25so7531247wrc.4 for ; Mon, 06 Feb 2023 09:14:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Yj1DEvs3X4/BfrWA87uKCI4tHJLA6vEN8CkLaerxWYk=; b=uN+LE8QHV5k6EjvWghp3O50yXscrEQvPXcZ8Fsli588A9iK5W1MA94UNcmwNu4V1ie gaLG1tmL21+2XNc3ddWALysIV1aSHtoMzGQHWpCrknHujmpR6ConTNewh4cEmfxPEri8 Kgn1pbmblo4eRZAoay/LnoM/NLjuD+gsjtlt8DJIbHhkajB08sbLfgxvyY0QsQYjzprm frLXb8pFJe/awtM+pR8HI3E+F/1/1oxqdyj+yaj2JQBlD5VTg9X9G+m5Fgyb8CE48+ja 5UOACTTL6/0/8nvd3A+8kZJaG8WOzzegxuiPRcLYovKy98kdW/fur0eOmeGzMBR4+2/I eY2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Yj1DEvs3X4/BfrWA87uKCI4tHJLA6vEN8CkLaerxWYk=; b=T2mR2ZISi3VkFvTMyRHeeWQOqfzPtIqcPD9NG+yn5rZgqJoKiMkZ/TUtu8qwVW8exM onIX0enDwjwW8CWD7lf71arEoXY0xetsedKnkznesKd/3CBbuuveh11lvijx2Fv+wIzE sy9R5p0T4PH2a/tom62bs3qFsp4QBLiQod9mm3ofLRHtMislBD7CqIGRoXwKFDYUQAOy ZlP9IVkI85h2EPLj/8XBSveS6phFe929ctWoT2e+MsJoS7+Wt1OXwsN68cEYMMZfuxWo h6hVO8iYEKlabzrAPsK2sSEuFJKzXmVKeB5oeF1HTNCb26NdfL+LMbx5jbudhGkMMkrW 3qiA== X-Gm-Message-State: AO0yUKWMUg5PiJm1N3zjn5mvv6Y18oI1PbUyvZwFxVI7Vfath0a4ISaD vD9A9/PQ+QqyqSqLNjoLztEI4hkQbmdGkqpQ X-Received: by 2002:a5d:6089:0:b0:2c3:ea86:863b with SMTP id w9-20020a5d6089000000b002c3ea86863bmr3150743wrt.29.1675703642588; Mon, 06 Feb 2023 09:14:02 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y10-20020a05600015ca00b002bfd137ecddsm9529841wry.11.2023.02.06.09.14.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 09:14:01 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , "Dr. David Alan Gilbert" , Laurent Vivier , Thomas Huth , Warner Losh , Kyle Evans , Markus Armbruster Subject: [RFC PATCH 0/5] Deprecate/rename singlestep command line option Date: Mon, 6 Feb 2023 17:13:54 +0000 Message-Id: <20230206171359.1327671-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The command line option '-singlestep' and its HMP equivalent the 'singlestep' command are very confusingly named, because they have nothing to do with single-stepping the guest (either via the gdb stub or by emulation of guest CPU architectural debug facilities). What they actually do is put TCG into a mode where it puts only one guest instruction into each translation block. This is useful for some circumstances such as when you want the -d debug logging to be easier to interpret, or if you have a finicky guest binary that wants to see interrupts delivered at something other than the end of a basic block. The confusing name is made worse by the fact that our documentation for these is so minimal as to be useless for telling users what they really do. This series: * renames the 'singlestep' global variable to 'one_insn_per_tb' * Adds new '-one-insn-per-tb' command line options and a HMP 'one-insn-per-tb' command * Documents the '-singlestep' options and 'singlestep' HMP command as deprecated synonyms for the new ones It does not do anything about the other place where we surface 'singlestep', which is in the QMP StatusInfo object returned by the 'query-status' command. This is incorrectly documented as "true if VCPUs are in single-step mode" and "singlestep is enabled through the GDB stub", because what it's actually returning is the one-insn-per-tb state. Things I didn't bother with because this is only an RFC but will do if it turns into a non-RFC patchset: * test the bsd-user changes :-) * add text to deprecated.rst So, questions: (1) is this worth bothering with at all? We could just name our global variable etc better, and document what -singlestep actually does, and not bother with the new names for the options/commands. (2) if we do do it, do we retain the old name indefinitely, or actively put it on the deprecate-and-drop list? (3) what should we do about the HMP StatusInfo object? I'm not sure how we handle compatibility for HMP. thanks -- PMM Peter Maydell (5): Rename the singlestep global variable to one_insn_per_tb linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' bsd-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' softmmu: Add '-one-insn-per-tb' option equivalent to '-singlestep' hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep' docs/user/main.rst | 14 ++++++++++++-- include/exec/cpu-common.h | 2 +- include/monitor/hmp.h | 2 +- accel/tcg/cpu-exec.c | 4 ++-- bsd-user/main.c | 9 +++++---- linux-user/main.c | 13 ++++++++----- softmmu/globals.c | 2 +- softmmu/runstate-hmp-cmds.c | 6 +++--- softmmu/runstate.c | 2 +- softmmu/vl.c | 3 ++- tests/qtest/test-hmp.c | 1 + hmp-commands.hx | 25 +++++++++++++++++++++---- qemu-options.hx | 14 ++++++++++++-- tcg/tci/README | 2 +- 14 files changed, 71 insertions(+), 28 deletions(-)