From patchwork Mon Apr 17 16:40:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 673840 Delivered-To: patch@linaro.org Received: by 2002:adf:fcce:0:0:0:0:0 with SMTP id f14csp1604421wrs; Mon, 17 Apr 2023 09:41:06 -0700 (PDT) X-Google-Smtp-Source: AKy350YHdmVCugjrSeyfnfqTWsXmEk37eCjlFSRj/s8Uv+y6nqJHyOjdOHGl2gmgZzvvme2GZyni X-Received: by 2002:a17:907:a08d:b0:94f:8f37:d4e with SMTP id hu13-20020a170907a08d00b0094f8f370d4emr2025407ejc.65.1681749666193; Mon, 17 Apr 2023 09:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681749666; cv=none; d=google.com; s=arc-20160816; b=0KCRC6KcoHTYFe0372ozJw/DM5z0bOwrLboZ8ldCdpyDToF9EO6v7Sn/LVFzzKpEty MGY21LX0ewqFT5ZZRmOeIWP1b6FlHnMItiyvhTanF4nYnClNXuKsLO771cysyhPUMR56 YLEI7EHWTvDHhxpAMPR0jsHw4LmQHz/fkAVvnqVVT28yHMASXMj81njreQ3O/87n3WbU j/cKNP0sGyiXtXKn0moETj3pNQCQxW2kFcqiKueFqHYvOxzAvZGnytjdyLdlDN6Lm5d+ M38o0FWlz9VJR9gmiq52r628I8IJ6qeT5nZbk6nXAXS9s0bMfECE2JlAH+vRNIve8Vh/ xevA== 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=p6Rq6d1Hv/zkHtdwcgnd6mnoTvLT3U0+uR+FS829PXk=; b=Ss1IWTMGp3viSOh9hrqQARHyx4KX72YNqSMmEpQ/2zfpvErygqFUSj6AbIdjmht1Vp yROQZhIq5Sk/X8qiEXZczzp+KAFJdRFQKg9q5Mwo8o7yGBT74pJa3sI03ne5XaYGh1s2 jwxWYk6DJqeyAAuLgvQtHByPLU5qynIvqAqGotdD/Kx2I3JV/D9xv+qOserLZISqf7/t HSc+py/OigrhX+qVoys+rpWAFof5Z9FHgnP0KOQG5u8ECT023fbHFPTihRSWNWtP2G3X 81mcx58BR8Z9kuNbt4Dt0mSC4sYIB8vAda0WtzBLapdzgpc7WB1YsM9rabp4u2K87xMT o1qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dEg272d3; 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 fu30-20020a170907b01e00b0094ed24294dfsi7832882ejc.324.2023.04.17.09.41.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 09:41:06 -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=dEg272d3; 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=1681749665; 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=dEg272d30u8YrMCPAS81/4Ycuau+jKSE1rtcXadNOpJowKDvdyd79hDMF38bGbJgkpMc1C EC3xubazEvrNcGKU6WNo82rmeAKOX9vA6/ejNhV8Y4ZPH1UhpU9YIg89iX0bLOQ/++9Gs4 k+mefqfOgG5eFHVsWrMOtXVovzC9+NA= 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 X-MC-Unique: QSk2u_nhMU64qfn7P_SL9A-1 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) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com 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) 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 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 X-MC-Unique: eTdaZlLBPK-8m3LKOYvdpA-1 Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-2f40b891420so1711263f8f.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=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-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) 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) 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 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é --- 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 +``-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. Environment variables: 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 = val ? val - 1 : 0; } -static void handle_arg_singlestep(const char *arg) +static void handle_arg_one_insn_per_tb(const char *arg) { opt_one_insn_per_tb = true; } @@ -500,8 +500,11 @@ static const struct qemu_argument arg_table[] = { "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,