From patchwork Tue May 2 12:14:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 678368 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp472335wrs; Tue, 2 May 2023 05:19:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5WsZFS/Yu7mCNJQSU/8CJSOwu74/v8QvSH4RrIJwYbPchQJxU4f55He8ZPuRwZk5obwHdI X-Received: by 2002:ad4:5b8b:0:b0:61b:6e8a:4366 with SMTP id 11-20020ad45b8b000000b0061b6e8a4366mr383469qvp.1.1683029986998; Tue, 02 May 2023 05:19:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683029986; cv=none; d=google.com; s=arc-20160816; b=CfcBNJeQQeFgzX3XPfdLG3jF/zmiw5vIjg6tyzQQQWitLAP8neXCIRZpDHDKWwPySL zeN9lSqb5AROW2WWyVic0ndIwdcgd0dafD7TZ6LBHqJIxADgIlwQLxyzq58YDhRydHn9 ECpAX0u+CuWI9Q5HVBJMl4w3VLxp5YQqA1PmloYF7isl0mPdL+If5GtpC/cfTD3AcSsM XrQp7SqByamT1UmDcvQmH6xLWw+kp1/Y7pQSIQW07fxP1J4Sz7CIwkGhKcZ85HxJi7or ymBNfDfYX1SXATtZj2ivwjA60jBpmCdA0lyLphn+h7jIBPt7CTGgOKsRFsCZFnmUb0Z7 nAkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=HvcZB1nLO4O7UxWgLqh9cONwlcXJM51ksSbsOzMDZ0U=; b=rQ1rFPOtC44oFvFx0MWRqTmdHPMcBfujIchHhXVFF25OAU8101SzQ5hnOHJ/o48v9L yu503TxINp3qr0Ce33V2MP7BKsEx8+whUnPZvgbRNjDvqy80I6cuug3JjbcJ6972+/Jn xmk2gV0qcP1NhRSOGFY7KJGYJD0mEJc4ldvvoo5U/6K7iZJSI7rSlEsOJnJpF/wWYdvh 3yuA+LxSyJ2+tVM21vyoeIJzIoQBbjpG1xRcUOyrdW3DmAWSCikMJtDm4JADOHBTFqVT JvGmQ3F8B8p9THTMeCcpH2ZK4qCIKn9Lt35uUsOkUsmN8Cu1zUCvCSfgwApjAJE6WZEc Kelw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rdq0QzxY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c23-20020a05620a0cf700b0074e32f0b37esi15674027qkj.301.2023.05.02.05.19.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 May 2023 05:19:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rdq0QzxY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.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é 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 +``-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,