From patchwork Mon Feb 6 17:13:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 650948 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp2393526pva; Mon, 6 Feb 2023 09:15:27 -0800 (PST) X-Google-Smtp-Source: AK7set9AoKeIjBOd5RNjfyxI37tP2kUnHFQyxHlQ2SgAVRcfgDEvmN0t3JTEG9IYVn4uwshCf8iH X-Received: by 2002:ad4:5beb:0:b0:56b:ef0f:ee16 with SMTP id k11-20020ad45beb000000b0056bef0fee16mr436629qvc.7.1675703727637; Mon, 06 Feb 2023 09:15:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675703727; cv=none; d=google.com; s=arc-20160816; b=afp92571XXYWTTuo34FyU/+snO1yM5Pp96JpgB7gSTK6vsCxwQrBqeS1e+gEvu75Bg kutTyYmqsIaKFRKZXgwKHgq2+aKzqUj+gos6nyUZbI42mqEhZvPxzCI6MyAK8cWGmBNI dnfpisLCmanAHJa86hcn9dZqnM9HR6jZqaktQ5P+E0s0mEXpJ8QVziw0i+gMsPRBrRW8 XI6FjFuhRzZEODlgdcb/ktpgUyLNT7j+Y60Mmv2BLuLJNpViJ4k/FgSw3yW0eg8tKLWH XTmu/nsgw5MHCJ/NziRaxyK+FYw/Sd4ZdFvuM6+4nz46TDCVuRsjSsM1OXXKal7WmBvj DI6A== 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:cc:to :from:dkim-signature; bh=i0Jr8DH9OG5vGfeN7iONeP5ImzvUd60F7hUAYLN+I10=; b=pYyWNVXO8ySVsJaiCLPmPoqLTVJe8BZKd84OVZSepIjr++2ZE4D876v9BLh/+HMvpk cIMj4je5Xqk0FhxrPIPuF7naty7noY44Wd8J1oJNuJU/o+ZmhlKRScF69G1Go+SIruNe pGwwEX7Ce+OSbp4CQde4JHgHlFSzG+/PHat3I4L/bXxfupR+MkRRrJ50Klx3EKiY5LgX MNMYkSKiIJI/xz6BD2IhOHaylWsLc47b8Th7vjdjVPpt3m63IoIfB85NU2CD6qxUhg12 zKz9aYqul8mx3TtJTFTGdkELKcTLV6j3d1IbPt4X1vi7Kgso2eSFEwEN3iPsNqC4yQcw jmHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HFsfwTlV; 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 s2-20020a0ce302000000b004ef59b08985si4643318qvl.162.2023.02.06.09.15.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Feb 2023 09:15:27 -0800 (PST) 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=HFsfwTlV; 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 1pP54L-0000jx-CU; Mon, 06 Feb 2023 12:14:17 -0500 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 1pP54G-0000hw-2W for qemu-devel@nongnu.org; Mon, 06 Feb 2023 12:14:12 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP54A-0001Qb-Ln for qemu-devel@nongnu.org; Mon, 06 Feb 2023 12:14:10 -0500 Received: by mail-wr1-x432.google.com with SMTP id ba1so7006259wrb.5 for ; Mon, 06 Feb 2023 09:14:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i0Jr8DH9OG5vGfeN7iONeP5ImzvUd60F7hUAYLN+I10=; b=HFsfwTlVS7H36hlbk8MGiLGB9AeDrGhw49moEB2O1/KNJCDnke7PG0oDF0fAQld7ao 63r4E7GVs+Rs/rZc6avvuTrQ/z18vQTrCGrVCRlbzZff+9n/WaYo3hPZ0ePF6q+0VBPr wBCOOkNAYKnPl1KfzTGVE6FtIAMDdtNQ9LYgyr20HMBSVtfDlyHf50JZVxnoU8aq9ORW ny0JWkpcs5kHNxpc49etfcFOSg5skPZFn6LBbmG2mDq6cHL9C1n5qRRPwGmPrE0nnAhv 85EY28fGvfcxoGp6xDt0plKJn4cXrYcAhBEwFu3iCtKcA4Ryu21zscIjhVagTdwASym+ bYTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=i0Jr8DH9OG5vGfeN7iONeP5ImzvUd60F7hUAYLN+I10=; b=t3ZMJUR1w/H2pqRC1lSXNKhXX/TeqZ0zRFNJYWsdTXIIWFx39a9unX60YtRuAnl2+T hg+Szc/V1eY5dXBS48nildHNYkT3LK2cndtBdYSFLJQZ7jDQzArE6/Zg/lyvjfFGrAAC AGteauRK0wQK1v6svr3E1metpw3LvzEBjBU2tcn4GIdnpiQDcmuuQEX7mrEqhhiQ2Ikn skpRicvL16bCwJ8/tiS0axemDyUNl6d1T0vyMtnAJHPCzL/pI4uz6cgvAmjG4VgKQ/gU 0n0tDS1qVqmzjDKEXyNdCjgDxCltoJEv+vWl5+7ez41FvyedwrwGHZO0qktTZsbjv/ae FNSw== X-Gm-Message-State: AO0yUKU6LJseSA7VSPLOx49wZ6SbqwzVgIAQcaRyotgMKd9KLMGuK1JO Dko1RIvp15Ge+k2w49BCjTnRK/LRvCjPKG95 X-Received: by 2002:adf:ec06:0:b0:2c3:ea95:4726 with SMTP id x6-20020adfec06000000b002c3ea954726mr3419106wrn.34.1675703644879; Mon, 06 Feb 2023 09:14:04 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y10-20020a05600015ca00b002bfd137ecddsm9529841wry.11.2023.02.06.09.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 09:14:04 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , "Dr. David Alan Gilbert" , Laurent Vivier , Thomas Huth , Warner Losh , Kyle Evans , Markus Armbruster Subject: [RFC PATCH 2/5] linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' Date: Mon, 6 Feb 2023 17:13:56 +0000 Message-Id: <20230206171359.1327671-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230206171359.1327671-1-peter.maydell@linaro.org> References: <20230206171359.1327671-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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 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 --- 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 99bcd542b42..41089e51cea 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -395,7 +395,7 @@ static void handle_arg_reserved_va(const char *arg) } } -static void handle_arg_singlestep(const char *arg) +static void handle_arg_one_insn_per_tb(const char *arg) { one_insn_per_tb = 1; } @@ -486,8 +486,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,