From patchwork Mon Apr 17 16:40:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673836 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604383wrs; Mon, 17 Apr 2023 09:41:02 -0700 (PDT) X-Google-Smtp-Source: AKy350bh/8XD+fai1x5qrppG2LPkh7NNOx1q2y1PlNsRGkzlGNBmyx1EQjDd9tvK9UcQzEpUCs+Q X-Received: by 2002:a05:6214:2a86:b0:5ef:5033:f37b with SMTP id jr6-20020a0562142a8600b005ef5033f37bmr21300156qvb.41.1681749662703; Mon, 17 Apr 2023 09:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749662; cv=none; d=google.com; s=arc-20160816; b=If12YXJW0hj93IrW/NrlDDBy7EeIyrBCMthbdfVP79lxSzyaTB2c7EgARY81nkBaXk 37Wcgg4WC9DF8+fQxFwuOKJdC9EJea/0CngWPSzSI8lzB3am20js6FJ9mEpK0EcIRg3Y 4XCibFjZCEcPXP1kK4RuZTt7Q8eLUqLUjKbgGrnhWBGjxHVchmy8IiM6kfdzv+7eNmGJ 5gTjjEWvc0HAqCupJXsqvJA2BxuOUe1NYsGjpfdFcC1yl9OI0q5hZm5y53gc965NsTQx FL8PyviDSCxuIzK6U27xym3e9TPCHrqtpTCo8YZzX+e1NNCoaR3U2qG43O2yQGk56J4T LE7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=9zh6XCv4IvteabEjdIcioL96syD6sHRMrwiuxQ8bgkY=; b=s175gnRqr9GFsE9uQsWr+/z/NPFWnYdpWs+AGeP2xk/US9uNWrl6pEwDSpx7Xz6yl3 1/aWq/MXznYzM/ciazWom/S55n2xnA5rbfyN+IbGUoZA3v/9zvSomI0pGvoA+29FyWWx fgfn3L1mtBNdJYXEJ2e1Lhxl1BwsSs9DqZeACwrkadImmiMV5+gTn5JxLQHfeawL1LDc qh5Uvn8fGfNMN7DmQtfmTUF97rbHRnD4C6w14mwPkM1rSn56XdEqSglhLEWKAWqQBbjw fGiaxyNDJUGMrJdrhNYguQab9NXovIEA/Ve2UpoPjp7VQ9vqhVh/yNA5I2h37kbfsttT poNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="OiU/VPhf"; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id kl17-20020a056214519100b005ea2f1bc30csi5675993qvb.332.2023.04.17.09.41.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:41:02 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="OiU/VPhf"; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681749662; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=9zh6XCv4IvteabEjdIcioL96syD6sHRMrwiuxQ8bgkY=; b=OiU/VPhfad9g3ohQeyR2kKjHJWhabLOxKOmq0zsOFRoUCjEwpY9GUlP6FW0Mme4+9y+Z2y LqzoGnSRJyr0n70M+4PXRJJQq8g1HhADnLoc76MzISJI2yR3vrd7mX60AlYe3nnQuNN9Kn fwVTCGmNJHTHuXhc6euqBaAMn1YFiVw= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-494-RHpYvnkfMqSlw5fCRgQq8Q-1; Mon, 17 Apr 2023 12:40:59 -0400 X-MC-Unique: RHpYvnkfMqSlw5fCRgQq8Q-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0C5D738149DC; Mon, 17 Apr 2023 16:40:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB4E3492B0C; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A0C4D1946A4E; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1CA7C1946594 for ; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 113F6492B10; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0947F492B03 for ; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E45B48631FF for ; Mon, 17 Apr 2023 16:40:50 +0000 (UTC) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-307-wITpFqiUPmyN3MNvG8tUkA-1; Mon, 17 Apr 2023 12:40:47 -0400 X-MC-Unique: wITpFqiUPmyN3MNvG8tUkA-1 Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-3f174cf526aso4881425e9.0 for ; Mon, 17 Apr 2023 09:40:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749646; x=1684341646; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9zh6XCv4IvteabEjdIcioL96syD6sHRMrwiuxQ8bgkY=; b=JyU4cpWQwIlcIEsKG30DGn8fFRJN0XUOITqaja13yViHt+nV+L4g7N4jEQuBh1UvCg Micht0sqPbInhp8yiR6HQ6EzGn4Xydt7QzDjulTSavCUWYUX075C+F3HpWKRNVx0J9Un fVLWenCPiqcpG/uLaDVAnlLhYCGxGz2tbTnjDdRAnKOHyBSAuzryW0v5u+tUrl7p1XNk K1Wk+M5J/PbZYczvXWm11i2/40Xf9eaTy9xcSpTa1kw4s7uIRXPxICNNsajky6y8upK7 42qYEGsxgjsEIxkND+cuay9tzEjJW++u5h6/RXeSGeaGCfmZqk4YhLmNJA/MVKxZ/+XH Tkpg== X-Gm-Message-State: AAQBX9drG71XC6C9zTqrxc30helcF4O0P3urjjQWIBx4FkZ05IlIMEqh ZUW70twgQu2YrysZVgVUKCOMtg== X-Received: by 2002:adf:cc81:0:b0:2d5:39d:514f with SMTP id p1-20020adfcc81000000b002d5039d514fmr6574853wrj.65.1681749645865; Mon, 17 Apr 2023 09:40:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:45 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 05/10] bsd-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' Date: Mon, 17 Apr 2023 17:40:36 +0100 Message-Id: <20230417164041.684562-6-peter.maydell@linaro.org> In-Reply-To: <20230417164041.684562-1-peter.maydell@linaro.org> References: <20230417164041.684562-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: libvir-list@redhat.com, Kyle Evans , Richard Henderson , Markus Armbruster , Laurent Vivier , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org The '-singlestep' option is confusing, because it doesn't actually have anything to do with single-stepping the CPU. What it does do is force TCG emulation to put one guest instruction in each TB, which can be useful in some situations. Create a new command line argument -one-insn-per-tb, so we can document that -singlestep is just a deprecated synonym for it, and eventually perhaps drop it. Signed-off-by: Peter Maydell Reviewed-by: Warner Losh Reviewed-by: Richard Henderson --- docs/user/main.rst | 7 ++++++- bsd-user/main.c | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/user/main.rst b/docs/user/main.rst index f9ac701f4b1..f4786353965 100644 --- a/docs/user/main.rst +++ b/docs/user/main.rst @@ -247,5 +247,10 @@ Debug options: ``-p pagesize`` Act as if the host page size was 'pagesize' bytes +``-one-insn-per-tb`` + Run the emulation with one guest instruction per translation block. + This slows down emulation a lot, but can be useful in some situations, + such as when trying to analyse the logs produced by the ``-d`` option. + ``-singlestep`` - Run the emulation in single step mode. + This is a deprecated synonym for the ``-one-insn-per-tb`` option. diff --git a/bsd-user/main.c b/bsd-user/main.c index a9e5a127d38..cd8b2a670f7 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -162,7 +162,8 @@ static void usage(void) "-d item1[,...] enable logging of specified items\n" " (use '-d help' for a list of log items)\n" "-D logfile write logs to 'logfile' (default stderr)\n" - "-singlestep always run in singlestep mode\n" + "-one-insn-per-tb run with one guest instruction per emulated TB\n" + "-singlestep deprecated synonym for -one-insn-per-tb\n" "-strace log system calls\n" "-trace [[enable=]][,events=][,file=]\n" " specify tracing options\n" @@ -385,7 +386,7 @@ int main(int argc, char **argv) (void) envlist_unsetenv(envlist, "LD_PRELOAD"); } else if (!strcmp(r, "seed")) { seed_optarg = optarg; - } else if (!strcmp(r, "singlestep")) { + } else if (!strcmp(r, "singlestep") || !strcmp(r, "one-insn-per-tb")) { opt_one_insn_per_tb = true; } else if (!strcmp(r, "strace")) { do_strace = 1;