From nobody Wed Apr 16 00:19:36 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1683029987; cv=none; d=zohomail.com; s=zohoarc; b=nmo70c5taMfZ4AOlJITNnhediksLX3xxkY2gaq4vrt21TuiQD5pFhay6i6BBsWlgK19M/4D1cV9VqsiuQGsW7mnrKoSbV2fEIQLtQZuoav3jk350BEc/nDpATQDPkIODjXxswvQLOiS4+PMHQXkjPetEkONJdFQBP9bj+D9fZz4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683029987; h=Content-Type:Content-Transfer-Encoding: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=HvcZB1nLO4O7UxWgLqh9cONwlcXJM51ksSbsOzMDZ0U=; b=fa7btyTdjgLxpup3RB0jFH0fIgW9Hm4U+k+NJyXdxDRfZHIIxZsvfTdFEYeu5CmH7741+fMyYOIGLDcc8rINlH+j7RAmpzSlTJHVSs6TbkNpq5BFHdNLxeJ34eB1koPBYlSc3unDLGaCrG7tpHYxDEDhtpJYt3UmEb7YsoUhR8g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683029987409880.6341626429748; Tue, 2 May 2023 05:19:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptovJ-0004Aa-7c; Tue, 02 May 2023 08:16:01 -0400 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 1ptoui-0003oQ-T4 for qemu-devel@nongnu.org; Tue, 02 May 2023 08:15:36 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ptouV-0003Cc-9o for qemu-devel@nongnu.org; Tue, 02 May 2023 08:15:19 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-2fc3f1d6f8cso2210709f8f.3 for ; Tue, 02 May 2023 05:15:10 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id g10-20020a7bc4ca000000b003f171234a08sm35040330wmk.20.2023.05.02.05.15.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 May 2023 05:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683029710; x=1685621710; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=HvcZB1nLO4O7UxWgLqh9cONwlcXJM51ksSbsOzMDZ0U=; b=rdq0QzxYuWZz3O0Aeest5H0NB4J1pdY1QatAMXUppCbbk54O2E1onkkaDH4WQah5+S P3mqhJZ4dJsSY/P8gIW5IiPU2vR13XxmLKx/E6IoW9n9UTS2ZJP6bfqEvFsov7hrUw2F gJwL8H0ygYZ+ZCwojLRgO/JMlwzXKJkhDVzfnFYDdc1JzBZ+ypLQYzfOnQy0Pk4C9pR/ dnK+fixoly2+Ws9PqdjoR8lebgZLmPIq+1WD7uxlflkMgMkBX2G63//cRewkKY1xUhtm /2MbuPm9B0G4/rn0p/x62xNOYup5vgGwmswU0Aq1jlOkqixisWjxurGS6tfjFQxTrxYK vhYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683029710; x=1685621710; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HvcZB1nLO4O7UxWgLqh9cONwlcXJM51ksSbsOzMDZ0U=; b=k942lpbNqJEGgWMoIswkXFo2w8B6XwO6QEfFZODiDM39uE2EFJWYjdmSTkCnhZBlTB RzgnfF/DJe3AOFfpYuvXIVyyBjHOc8jADlaYqe8hk8CSoUm5/5BZWdn7P0EL5W2SgJ7W hMfBQ8gVkPHRiPDLvj+u90eF6g/YaUBpkw4hXIo+qDLAE7eEWqRv8uRxDplp1DlmX7l5 o0ObtrjJZoa8TJ8s9Z2Z3KuiUUjRInlKRqp9r9hKJSkx1I1Yt8ze2ZUi+yvZJ4tTX2HJ IoXKlbQsuf/cWaczQ2lBQBwShm+cxVERQk+CBHx2vwMiJbPKjG8Jk/Y9nFBbuQrNLIHs TL+Q== X-Gm-Message-State: AC+VfDxzcn8F4QWWPL2GdnmEYRyw3Xopp1USdv8XoVO5PUFt4rdaLO61 T+dcQDF7TpvMGUuYO0v/LyGdn8V/8lqmUWFG704= X-Google-Smtp-Source: ACHHUZ7sTh9NhecOHRFsV5ZBR4io9UTvEhHhVstZNvNJyjiX23krdvB15jVr1kLIIrRfJQ+GZ/tXcQ== X-Received: by 2002:a5d:524b:0:b0:306:2fd1:a929 with SMTP id k11-20020a5d524b000000b003062fd1a929mr3825441wrc.7.1683029709914; Tue, 02 May 2023 05:15:09 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/35] linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' Date: Tue, 2 May 2023 13:14:43 +0100 Message-Id: <20230502121459.2422303-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230502121459.2422303-1-peter.maydell@linaro.org> References: <20230502121459.2422303-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1683029987965100005 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 Message-id: 20230417164041.684562-5-peter.maydell@linaro.org --- 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