From patchwork Mon Feb 6 17:13:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 650950 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp2393737pva; Mon, 6 Feb 2023 09:15:50 -0800 (PST) X-Google-Smtp-Source: AK7set+80+/6aSQUbRu4ngLu+jB3b5Nd+VUXMh9ZQl/HrZpKbtwYavOZ8pxyQ8VyI5U455T1Q9jz X-Received: by 2002:a05:6214:2264:b0:56b:f097:a34b with SMTP id gs4-20020a056214226400b0056bf097a34bmr13127469qvb.3.1675703750239; Mon, 06 Feb 2023 09:15:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675703750; cv=none; d=google.com; s=arc-20160816; b=Iw5Q4dgRLBZWe1jAy/m/vdQ4kRsqpyUbRDZuXSl9F0vnFI1IqT72yd4DCein2A+CNZ +mEKkSXqj2bmq4rzoeMf0AFq8ePZfJLKUCqkRytILmH+2MTKbw5TZxvQv1xm+wXYDNLf 0jEjoS9eNs+qCKlYeWudDvLFilaoMc2LqX9fmdrSFAOi+ekW70D8nBvId47IvTvF62uP uzKRrlDiWwIN06UmJ2CjlhEeHAqKorKeUfQWF1gD2W3pHbdGtSZA8Jhx7DLJzIo6jW6A jWe25p/lh84Cu5rm3Y25fwKN2YLlcJoFw/ffmpU01Qa0eJNmLm8JDYaB8ELZwV6BeMDv LIOA== 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=CMZp74yJ4afPsnw6Yc/ZceAsQ465N4IhpQ4ktRnsEtk=; b=NgHbCS2L2yFiYy2fteZjSB3VDCuTzLryBknjOLp4WSHjFYx1++xSTcZ2sRZY3TiRXz 0Wr76N88qDP/jWDPNBff1/cj+ppRRClS0VZvB9FQYrPdNytm1zES7TKPwLZI/oEjnwd8 G5EQlICeKUGe8bsfF2Ydl2HwghF1T3LHBUCjAShoXPfccYVXPyxIhXm9IZT8Do/D+wXq PsM/VmXVyb1LME1nHyiLb93Q/KjXlTwN/tya8L69dF9BtNrKmQiCyxFs26agjeEEgBcv 445A/yMdNCNauMtbLEsyfvJzadZLpV3KFwP5YfxysK/veadGRXYLwfW7QzsX3OXu8YJ3 GoJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hLHro6a7; 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 w13-20020a0ce10d000000b0056bfdecebe8si1659646qvk.157.2023.02.06.09.15.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Feb 2023 09:15:50 -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=hLHro6a7; 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 1pP54K-0000jh-Rh; Mon, 06 Feb 2023 12:14:16 -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 1pP54H-0000hy-2v for qemu-devel@nongnu.org; Mon, 06 Feb 2023 12:14:13 -0500 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 1pP54C-0001Qs-QF for qemu-devel@nongnu.org; Mon, 06 Feb 2023 12:14:11 -0500 Received: by mail-wr1-x42a.google.com with SMTP id h3so3229334wrp.10 for ; Mon, 06 Feb 2023 09:14:07 -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=CMZp74yJ4afPsnw6Yc/ZceAsQ465N4IhpQ4ktRnsEtk=; b=hLHro6a7JUkB6g+l68fFB4zvtMJIaTGCt+1zRswoktGwMtDLg6KV8w+Ypw0SXyllTm rj3UFdosRDxj9H2dT8Xhh57d6/kStojs+FhwQIOMQVGrM1NuPmVhpLvDzo4VHLDlyuPH 4B31g++gdHwTK5GhubeG+b7bFv8uYiGlPiivQBLai4rDjCleEVW0LspsOjOnXSsH8O92 GODftsepxJU7Pqm+GhPiE1R8pj6ZLqKsZFMvqozhWuA5oU2F2Imc7S7T3Ce30aKdhnrd 41aSfu0V2/RT+xXkm4oTOW7lHsbMWVEaH31mhTTYFrrPM3j3o0P7L/AfstWwsj93gmZw lFAg== 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=CMZp74yJ4afPsnw6Yc/ZceAsQ465N4IhpQ4ktRnsEtk=; b=rvXCAC2FMZ8knnYAvxH7JPYsi1fcGcJ234J8clYVn3T6Yy3pd90KN+bSdGDIHZW2qL kSyZNoQ4oPtOizvmf8+x7UFtPsQ0c6THqXpXIdRVb61bUQW+17/aHqlsL2sUvyAsNw0C cRYnxZ+SEnd656DOX0TMVtGHVjI+lO+q42pk9nqmf5Mh9BT++iCa2QgIgKAXf/9DG09J yP6IUcWobG4Km7EHi94FZF29mXwstcpZc3f27fwi114hPfAwyp0oTAYQYmRrPDdfCY0N NsOLiG142l55lypEnH3QMNPoUQC2HDq60B2lEncIhqSxPXJAdxOVlsK2DY0WKgCZRJ4T 0dxw== X-Gm-Message-State: AO0yUKXbuUzsrCRZ5ca83iwhcMDM3HR1hvxzwoDon7jdSwZxAMyJNvlI uShqEDuK1UtFghm0euyAQZgo+w7r1tPqxCI7 X-Received: by 2002:adf:ff90:0:b0:2c3:f0a6:43e3 with SMTP id j16-20020adfff90000000b002c3f0a643e3mr983048wrr.39.1675703646851; Mon, 06 Feb 2023 09:14:06 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 09:14:06 -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 4/5] softmmu: Add '-one-insn-per-tb' option equivalent to '-singlestep' Date: Mon, 6 Feb 2023 17:13:58 +0000 Message-Id: <20230206171359.1327671-5-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::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 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 --- softmmu/vl.c | 1 + qemu-options.hx | 14 ++++++++++++-- tcg/tci/README | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index dbe5124b5e7..61335ec7bc0 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2957,6 +2957,7 @@ void qemu_init(int argc, char **argv) qdict_put_str(machine_opts_dict, "firmware", optarg); break; case QEMU_OPTION_singlestep: + case QEMU_OPTION_one_insn_per_tb: one_insn_per_tb = 1; break; case QEMU_OPTION_S: diff --git a/qemu-options.hx b/qemu-options.hx index 88e93c61031..184f8cc36d0 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4158,11 +4158,21 @@ SRST from a script. ERST +DEF("one-insn-per-tb", 0, QEMU_OPTION_one_insn_per_tb, \ + "-one-insn-per-tb run with one guest instruction per emulated TB\n", QEMU_ARCH_ALL) +SRST +``-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. + This only has an effect when using TCG, not with KVM or other accelerators. +ERST + DEF("singlestep", 0, QEMU_OPTION_singlestep, \ - "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL) + "-singlestep deprecated synonym for -one-insn-per-tb\n", QEMU_ARCH_ALL) SRST ``-singlestep`` - Run the emulation in single step mode. + This is a deprecated synonym for the -one-insn-per-tb option. ERST DEF("preconfig", 0, QEMU_OPTION_preconfig, \ diff --git a/tcg/tci/README b/tcg/tci/README index f72a40a395a..751558f2892 100644 --- a/tcg/tci/README +++ b/tcg/tci/README @@ -49,7 +49,7 @@ The only difference from running QEMU with TCI to running without TCI should be speed. Especially during development of TCI, it was very useful to compare runs with and without TCI. Create /tmp/qemu.log by - qemu-system-i386 -d in_asm,op_opt,cpu -D /tmp/qemu.log -singlestep + qemu-system-i386 -d in_asm,op_opt,cpu -D /tmp/qemu.log -one-insn-per-tb once with interpreter and once without interpreter and compare the resulting qemu.log files. This is also useful to see the effects of additional