From patchwork Mon Apr 17 16:40:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673838 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604391wrs; Mon, 17 Apr 2023 09:41:03 -0700 (PDT) X-Google-Smtp-Source: AKy350aoprRc96//GjZ/gREpDeHqz2tbkoMEzg5DMvRBGdeQc40uVCLhpEYJtsXfQp3uFYrOCM4U X-Received: by 2002:a17:907:2ccc:b0:94f:3cb2:934c with SMTP id hg12-20020a1709072ccc00b0094f3cb2934cmr5486366ejc.67.1681749663769; Mon, 17 Apr 2023 09:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749663; cv=none; d=google.com; s=arc-20160816; b=fi1SiTP52sSRUJbPT0Df6QzpesqC+6LLFK8hkUwAtHIsXuMNQhj43iDLbfMowCzByr OHRcBlNDhFa7rD1zZqLW+QbFxrFZIHFdV69tQ44HnpYGxVXSdepxGDYZZDcmNQEWdIlO cYOA1P6DFdvxCm16b3JyjGtrAWweD7cUekxW5tXDmaRMJ4fPjYavR6RuwECMFthopS51 3cTmHaiZxoOXwYlIFUPnabjUjdWE3sJzQjprU3hM2ts0o4TvLlbN+ZiIvhu83c/wIpG7 hNWuyVTuZdDaFQI2A7Dv7w7gXwbnNez7xnrO8c4hF54BXE9Bppbz89/Dht8rll7qAS3F TtPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :delivered-to:delivered-to:dkim-signature; bh=Qt4yDIRMdcNk8ETy1SHd7WE53TtZeswN17iOp3UOs9A=; b=HFNaQTwEgIFp0+AIIS3U2Fdrk4WleRT/1umcl1SAou40r8UNWrTHgxCc6/rVVMCGa/ BZWtAfih5rPnjOqHYriV0gh+R2P1K6v92ZgHA2jJgK/TQ/qF4MH68vXIQHWK1GyeHz0s tfkWpNNgIpyDTZeAq0+8BIAPHBSZqXsE7nta6wTvAN11SjbX4m/uDwRQxXc8LO+j6BIf brWc15IAcdrCdssGNSHailHVZMweRHWg8bEwG4/C3kEmaUmZlH6Q52IUuLAfiXpkoaOr v/+4N41N6B182S+DNPsPZBUhmRJ031lD5jiCoFbJl8cOp81bd3HUJJD43wMap19ctEDL t0SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fadhfMBc; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id fr22-20020a170906891600b0094f24f7612csi5136125ejc.54.2023.04.17.09.41.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:41:03 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fadhfMBc; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681749662; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Qt4yDIRMdcNk8ETy1SHd7WE53TtZeswN17iOp3UOs9A=; b=fadhfMBckUb9mc1nUlrai8VvjRoFDiSPub/6U2N/q4I1rjbi4V7yEW39xsHM4qwRXYPtIH hqZrDkNavau7ApwUNCd7SoUtYziJHJU6oLXdt+ohMqYKt2NboLKhZx7omrxqHBBl8Bj+Fm sOvK0pW+KrgS8YkuZzY8sfFU8C9Izv0= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185-f_hFT0CkP52mhc8lAm-eKw-1; Mon, 17 Apr 2023 12:40:51 -0400 X-MC-Unique: f_hFT0CkP52mhc8lAm-eKw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 103EA1C0758D; Mon, 17 Apr 2023 16:40:49 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1C0B492B03; Mon, 17 Apr 2023 16:40:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A92D0194658D; Mon, 17 Apr 2023 16:40:47 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 614E5194658C for ; Mon, 17 Apr 2023 16:40:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4D5BA47CD0; Mon, 17 Apr 2023 16:40:46 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 456572A68 for ; Mon, 17 Apr 2023 16:40:46 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 25EFD185A790 for ; Mon, 17 Apr 2023 16:40:46 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-20-tBZ0chZANreq6yA0URCMGg-1; Mon, 17 Apr 2023 12:40:44 -0400 X-MC-Unique: tBZ0chZANreq6yA0URCMGg-1 Received: by mail-wm1-f43.google.com with SMTP id m39-20020a05600c3b2700b003f170e75bd3so1668586wms.1 for ; Mon, 17 Apr 2023 09:40:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749643; x=1684341643; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Qt4yDIRMdcNk8ETy1SHd7WE53TtZeswN17iOp3UOs9A=; b=C0dRZBhcCO9yE6dpZVHYsa8xBt+kkligRhSv/gQW2kH+m8pnlcvjYf+1whWHA/0mE1 MO0GhuvV0KpB24Tn5/yj3jE+bjq1ksEkzft/YnSSIQNGLyM/46wmQVgKjW1/McUeK9yD 3coaQ1L2CDLyspENVulV4AfwtNChUCjYFTuCMxqX251UZk0YitYik2PsPtqiZZFear1p NZJDImMWtePMRTib8aptgeJkGABRBDCHfHH3DMZc/HRPsgeYfsdEHNOlEEJvzzC929gW Mo83gaPT1dFwAT53gQSRyjLn9p7fl6s3vfmW4wEX3qbHhGMJMOqzggt15mfOJAao0knb 3wiQ== X-Gm-Message-State: AAQBX9dhr0ptIckvWDd3kZE1rI8u4ujDFMuWpMr8IuWOvEj0nCaDkv4o zfzbFhiHKPDtJwG2dOudUp4DOg== X-Received: by 2002:a7b:ce14:0:b0:3f1:65de:764 with SMTP id m20-20020a7bce14000000b003f165de0764mr6560109wmc.32.1681749642915; Mon, 17 Apr 2023 09:40:42 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:42 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 00/10] Deprecate/rename singlestep command line option, monitor interfaces Date: Mon, 17 Apr 2023 17:40:31 +0100 Message-Id: <20230417164041.684562-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: libvir-list@redhat.com, Kyle Evans , Richard Henderson , Markus Armbruster , Laurent Vivier , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org The 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: * changes the command line interface: for user-mode emulators, the new option is '-one-insn-per-tb', and for system mode emulators it is a TCG accel property '-accel tcg,one-insn-per-tb=on' * updates all the places which currently directly touch the 'singlestep' global variable to instead get the current accelerator and query/set the QOM property (except the one internal to TCG itself in curr_cflags()) * documents that the old -singlestep option is deprecated * adds a new HMP command 'one-insn-per-tb', and deprecates the old 'singlestep' command. (Strictly we don't need to deprecate HMP commands, but I'd already written the code for v1 of this series and it's a minor user convenience.) * moves the 'is one-insn-per-tb on?' info from 'info status' to 'info jit' * deprecates the 'singlestep' member of the QMP StatusInfo type, with no replacement. (We have a sketch of a design of how we might provide this in QMP if we need to, but I'm pretty sure nobody using QMP is actually using the info in the 'singlestep' field, especially since it's always been wrongly documented and there's no write interface, only a read one.) Changes v2->v3: * curr_cflags() is a hot path, so use a global variable so it doesn't have to fetch the current accelerator object. (NB: I haven't done the tcg_global_cflags thing suggested in review of v2; justification in the below-the-fold part of the patch 3 commit message notes.) * put the new line in test-hmp.c in its proper alphabetical order place in patch 8 * in patch 10 don't provide a replacement field in the QMP StatusInfo type, just deprecate the old one * I finally tested that bsd-user compiles, and fixed the missing-close-bracket error in that patch :-) Patches still needing review: 3, 7, 10 thanks -- PMM Peter Maydell (10): make one-insn-per-tb an accel option softmmu: Don't use 'singlestep' global in QMP and HMP commands accel/tcg: Use one_insn_per_tb global instead of old singlestep global linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' bsd-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' Document that -singlestep command line option is deprecated accel/tcg: Report one-insn-per-tb in 'info jit', not 'info status' hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep' qapi/run-state.json: Fix missing newline at end of file hmp: Deprecate 'singlestep' member of StatusInfo docs/about/deprecated.rst | 39 +++++++++++++++++++++++++++++++++++++ docs/user/main.rst | 14 +++++++++++-- qapi/run-state.json | 16 +++++++++++---- accel/tcg/internal.h | 2 ++ include/exec/cpu-common.h | 2 -- include/monitor/hmp.h | 2 +- accel/tcg/cpu-exec.c | 2 +- accel/tcg/monitor.c | 14 +++++++++++++ accel/tcg/tcg-all.c | 23 ++++++++++++++++++++++ bsd-user/main.c | 14 ++++++++----- linux-user/main.c | 18 +++++++++++------ softmmu/globals.c | 1 - softmmu/runstate-hmp-cmds.c | 25 ++++++++++++++++++------ softmmu/runstate.c | 10 +++++++++- softmmu/vl.c | 17 ++++++++++++++-- tests/qtest/test-hmp.c | 1 + hmp-commands.hx | 25 ++++++++++++++++++++---- qemu-options.hx | 12 ++++++++++-- tcg/tci/README | 2 +- 19 files changed, 201 insertions(+), 38 deletions(-)