From nobody Fri Dec 19 16:04:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1681749668; cv=none; d=zohomail.com; s=zohoarc; b=oDrkZ2HO7pifKXV7pjp/syOXdTrklRB+8AQV5HcRvNF7HLexDbq1cUoCv4ov36avgZYzzDBbvAHrjXCzYb9wijI8SviOVW4s4q5YZHFfXPgdqPs5JzU9eCvfWxnwjIqPICTp7zGytG7xrItpEdJlay1gxMA39miSQY5xs18Dfro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681749668; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=p6Rq6d1Hv/zkHtdwcgnd6mnoTvLT3U0+uR+FS829PXk=; b=A8J3aa1tRt/UnxzTUZAcB+TVlremBxZ7dLlG1yVf+oUFBAFMMiKIXJ6EwDzOZKxlWcmySPc1I+VXelQAvr0uTW5M88qRyICuHDwKvZbXEFO/2hRzEFeCMhUbIzwFsWVxs3YEMR5nXlFZvPJAvNDaFx2AvrDWcMJjEIJ0okkgEoY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1681749668526836.3274356576427; Mon, 17 Apr 2023 09:41:08 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-636-QSk2u_nhMU64qfn7P_SL9A-1; Mon, 17 Apr 2023 12:40:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7FEAA185A7A2; Mon, 17 Apr 2023 16:40:51 +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 6AC5614171BB; 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 575D91946594; Mon, 17 Apr 2023 16:40:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 60FC419465BC for ; Mon, 17 Apr 2023 16:40:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 36CC540CFD3A; Mon, 17 Apr 2023 16:40:49 +0000 (UTC) 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 2E2E340B3ED8 for ; Mon, 17 Apr 2023 16:40:49 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.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 0FA5E85D538 for ; Mon, 17 Apr 2023 16:40:49 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-605-eTdaZlLBPK-8m3LKOYvdpA-1; Mon, 17 Apr 2023 12:40:46 -0400 Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-2f40b891420so1711263f8f.0 for ; Mon, 17 Apr 2023 09:40:46 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm2595103wrv.58.2023.04.17.09.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:40:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681749667; 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=p6Rq6d1Hv/zkHtdwcgnd6mnoTvLT3U0+uR+FS829PXk=; b=DYQ4j/rOk3anWcT41v1Q83I1fzPRr3xkAoU/ur0Ta1uotVq9jCMNwampDDbuPAXU0vbRWN d5Q9Qe/6AT7OFQ1W2eJkTSRlzWqE1T2b5v3NmwcG9svkYs2p9kidYVxbYr+/mD6QTlqGX9 QXP96DF4DwSsnoGZ+QZq8AbLgpi82rY= X-MC-Unique: QSk2u_nhMU64qfn7P_SL9A-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: eTdaZlLBPK-8m3LKOYvdpA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681749645; x=1684341645; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p6Rq6d1Hv/zkHtdwcgnd6mnoTvLT3U0+uR+FS829PXk=; b=OXWKsWc7fnoD6TPglP+jwA7cAKcUDMIurotlDjT+1hZGnBc6QRBFziZhphgRqHxj1H S+YzshkX/UL9GLvM710B7SyCEMYxPLe/D+RVKBbyogdY+NkWueM+iEf6zB0S8FA/4D85 C9MBYrPdw7RKDB7KXv78gaC8R++dcDP8nX8kqqgNDiCJp12PHEEVACfKmIAO5LdHLprT JoNOIQcN/xSgt0CMuq/bkgS65OKfejyrHmaIPdbYFMXPSkRcOSwAIXYOQ/F+kVuuLrX6 uRbs0ZugrdaFBAjuqkgmXv+hF3MR9zqj8YTTM+cDgXSr1gmhSd0LEvsnkc3BWi+Wges5 X6vQ== X-Gm-Message-State: AAQBX9e7qPAp/0d5rtjsQQLgM7Sn2nEtj/MzOXlxx4rp5j2LNUtljnhH cyDSOwVI9eLKQ+Of1xDkULqMyQ== X-Google-Smtp-Source: AKy350YsHcqybPJCRuIzB0Cyw++psKo0ZOIWDv5wU5RktE36vXAZHrbyrTNvOlhlAcBtcAwah1+ZTA== X-Received: by 2002:adf:fd44:0:b0:2f4:15f3:271e with SMTP id h4-20020adffd44000000b002f415f3271emr5854630wrs.2.1681749645250; Mon, 17 Apr 2023 09:40:45 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v3 04/10] linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' Date: Mon, 17 Apr 2023 17:40:35 +0100 Message-Id: <20230417164041.684562-5-peter.maydell@linaro.org> 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.1 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.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1681749669659100007 Content-Type: text/plain; charset="utf-8"; x-default="true" The '-singlestep' option is confusing, because it doesn't actually have anything to do with single-stepping the CPU. What it does do is force TCG emulation to put one guest instruction in each TB, which can be useful in some situations. Create a new command line argument -one-insn-per-tb, so we can document that -singlestep is just a deprecated synonym for it, and eventually perhaps drop it. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Warner Losh Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- docs/user/main.rst | 7 ++++++- linux-user/main.c | 9 ++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/user/main.rst b/docs/user/main.rst index 6f2ffa080f7..f9ac701f4b1 100644 --- a/docs/user/main.rst +++ b/docs/user/main.rst @@ -93,8 +93,13 @@ Debug options: ``-g port`` Wait gdb connection to port =20 +``-one-insn-per-tb`` + Run the emulation with one guest instruction per translation block. + This slows down emulation a lot, but can be useful in some situations, + such as when trying to analyse the logs produced by the ``-d`` option. + ``-singlestep`` - Run the emulation in single step mode. + This is a deprecated synonym for the ``-one-insn-per-tb`` option. =20 Environment variables: =20 diff --git a/linux-user/main.c b/linux-user/main.c index c7020b413bc..5defe5a6db8 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -409,7 +409,7 @@ static void handle_arg_reserved_va(const char *arg) reserved_va =3D val ? val - 1 : 0; } =20 -static void handle_arg_singlestep(const char *arg) +static void handle_arg_one_insn_per_tb(const char *arg) { opt_one_insn_per_tb =3D true; } @@ -500,8 +500,11 @@ static const struct qemu_argument arg_table[] =3D { "logfile", "write logs to 'logfile' (default stderr)"}, {"p", "QEMU_PAGESIZE", true, handle_arg_pagesize, "pagesize", "set the host page size to 'pagesize'"}, - {"singlestep", "QEMU_SINGLESTEP", false, handle_arg_singlestep, - "", "run in singlestep mode"}, + {"one-insn-per-tb", + "QEMU_ONE_INSN_PER_TB", false, handle_arg_one_insn_per= _tb, + "", "run with one guest instruction per emulated TB"}, + {"singlestep", "QEMU_SINGLESTEP", false, handle_arg_one_insn_per_tb, + "", "deprecated synonym for -one-insn-per-tb"}, {"strace", "QEMU_STRACE", false, handle_arg_strace, "", "log system calls"}, {"seed", "QEMU_RAND_SEED", true, handle_arg_seed, --=20 2.34.1