From patchwork Mon Apr 3 14:46:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 669784 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp1925440wrt; Mon, 3 Apr 2023 07:47:32 -0700 (PDT) X-Google-Smtp-Source: AK7set+QlboRrIqJPj8P7gSEQP65XLOe6rQ/SPrl7fJxd2yTBj2ROas/LG/QTwjvfNUmJQfdchjc X-Received: by 2002:ac8:5bc1:0:b0:3bf:da69:6107 with SMTP id b1-20020ac85bc1000000b003bfda696107mr61386289qtb.67.1680533252109; Mon, 03 Apr 2023 07:47:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680533252; cv=none; d=google.com; s=arc-20160816; b=yR96ci/e3Nk4tzSBEMiNS8mJZIlbisTwd+hdRkQLapYdsc28NjabRWf9lCLSoFuTgj iIXnKyiFcLelWhbIi6l6Z4IBeTlNJ47s5eVS44qeOpqxEfSQQ2gQH3QH5/Jn7XJ3WNgZ 06+qWf9ihzOGltNykZi3QHO56L09Vq+nNMIPsmT6Vutg5ID2OryFWWgVpPZJZUsM/Ht9 kylUm8hcDJb/puSIB55EwmK9ezYaTTkCFgFXykXq+Ggvw7a3Ar9NyJDllcaNjT/KygDI 4GhSAB4CgV1xKuJbw1TdjtfphfqaknaUQ3yA1AepcRp9skL9+Uj381wSRVH9ac8qFKi2 OeNw== 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=IM5IsuhD9SWzbJFvTVd/5A+kw5NS2zU/+ji41aVhTPA=; b=J3RG4mhpuNVhj4PGZ+SZbnCWpBaCFW14oCPWcb+w7IXVd3Sg1aMUl701PSUKRBKt+V 2reBJMYQuGaI0i7clqruvVk21gaLwwX8hyQifUOF1kgMs8FFMkNSENzaaCA6Rx7xfIIE pr3s8pFRQYSwdquvLIm2utqAIZU7xf2ssO3nH2ayiIr1373pXCrw4CY+t63LBw5wF0BG HRYWZH8RSpKNujfURhX2ZVLg366cdoCOAxqhrTl5fjn60vd/dpsiW26XJYmY5mfmq4KT QG5w3NZiftWg2sAxMf+x8PXj7sU96zqypPs+sTGFUZ06pYpJdI1pJsEn+NDDrATxQvbt pjWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GJo+lWOK; 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 o19-20020a05620a2a1300b007468dc6bbecsi6323766qkp.103.2023.04.03.07.47.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Apr 2023 07:47:32 -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=GJo+lWOK; 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 1pjLSX-0003uJ-62; Mon, 03 Apr 2023 10:47: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 1pjLSM-0003qg-66 for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:50 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjLSJ-0001AE-MZ for qemu-devel@nongnu.org; Mon, 03 Apr 2023 10:46:49 -0400 Received: by mail-wm1-x334.google.com with SMTP id n19so17286884wms.0 for ; Mon, 03 Apr 2023 07:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680533201; 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=IM5IsuhD9SWzbJFvTVd/5A+kw5NS2zU/+ji41aVhTPA=; b=GJo+lWOK5EC+L1Q52nA7EBpDQg+4w0ri284Yl8v7S6H+Z6CEd4v8uFlX72GXAgvOMX RcXsJpHxVrij9GEEfQKj5S+si2X+uf6l5+wc44OCbPj+o8BT7s+5sO55QM595cjR3ycJ BKJyM72bJRXHFjYKoRSa5MLhRz03XXQawk2uLD+A1fkOyLWmpOiAMvCZ6A/w0gBNegcs wPf5Fsg1/O8b8D/K2hVinufJwLfS4T+V6ra9xzDMsQieGsvc9djIPGRMaw8umLUmW3+C JAhyzisgNLl3Qh0yg8tuReaD3n0KTQaZRN4QwZvnAjRLTR0Qn3mWK6P3qqdnWZRI5w+G ME5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680533201; 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=IM5IsuhD9SWzbJFvTVd/5A+kw5NS2zU/+ji41aVhTPA=; b=w2dXJzl1ltWAcF5viQObwJ+1NTtbQSA1/dW5gkqIMzLfhzVeCYXeM78W1aTVPQsEBq QYAW3S+0MgsWP4GIktuCo1+GhNb3ztEvx4uT09OgPU/Awf6vADGGtaSxlTWBaOU+5SvA 03NcuRY8HGrBA8JbtOsR8duk8KX+lL/QTMlf4Kw5X/vL0XmAfXFf8ZVWCz6EThOqbj0p EAZ5sCytjQfxKBOoP8G1P82aqzDRDq/YC/sKQ8Oj+BkvAtptm8ZsenzKIqSyVcyTgTBc NSE85CUzDyS/4ndAYDRvx30N5bQH5nowddccKs1CiY5Bw8GifGZa+1kUCCkCDBh3dhLn sZ8g== X-Gm-Message-State: AO0yUKUFnF6931dIQLHXIyHeRl10YC9+q2yUJZ6vf6F8ZRruLZA78HBz bqH8lxD3qkgQ2sNx+QxtwKzxioC8UaQ2oI46dOo= X-Received: by 2002:a05:600c:21d8:b0:3ee:5d1d:6c2d with SMTP id x24-20020a05600c21d800b003ee5d1d6c2dmr25667055wmj.35.1680533201775; Mon, 03 Apr 2023 07:46:41 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id p4-20020a056000018400b002c56013c07fsm9786747wrx.109.2023.04.03.07.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:46:41 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Warner Losh , Kyle Evans , libvir-list@redhat.com, Markus Armbruster , "Dr. David Alan Gilbert" , Laurent Vivier , Eric Blake Subject: [PATCH v2 04/10] linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' Date: Mon, 3 Apr 2023 15:46:31 +0100 Message-Id: <20230403144637.2949366-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403144637.2949366-1-peter.maydell@linaro.org> References: <20230403144637.2949366-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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 Reviewed-by: Richard Henderson --- 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,