From patchwork Mon Dec 14 15:57:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 343560 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3116259jai; Mon, 14 Dec 2020 07:58:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJySp1CtEr2J2QjOwoRoA1gVYBamKDgGqBEQ0ZQd1mlgy0n289yhTxBa0ILJBQnStZ+T+7VN X-Received: by 2002:a25:e804:: with SMTP id k4mr34855133ybd.230.1607961512492; Mon, 14 Dec 2020 07:58:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607961512; cv=none; d=google.com; s=arc-20160816; b=AJFffebHXvPGHnK29Tv92b+fApSjGIopVMJ2rgQmYbzl0zO9mQnhznty66aKDoaUEn Sphk978/fzYwgDR7iAUuijI1sGJ620BMavuRGr4Jtp1D2v/q6ByVHQpIj570YA8KuTEJ 0pVO1DD61eFLNL+KBR/Nr9o10UI3S4Jy29z/QpGGi6ft0Q9nRMLPSTdq4widQBeTMjFC A8HUCUfTDMoiQl8qNfgYTUF+mZFPIzXPiZ+NsaGVozFwlmVSeflXMGYD84fTLiFrI/8S bJj8TrO6s8VAPFqVX8Gk7qmxl/QeIQDzHjoQEpICW03r+CsB5lPEWO9HgM/NSd1hasmT Yl/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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; bh=KyhGqrsaDtdpAgptl4gjMdg5K913sJWtlL7mA9EeTvI=; b=HI7aor6rbgmjszTCdq1njbfL3p2xB3bRtP8N8yo/6JI9V+N46o9VjpTQCQhnkHsBlS Vr4bwyRboBSwHNoDrdR/DuoUppYgVXMSHVrK97HL/S9WEP3bWWHfoGBKb1AcDBYV1fID JFc6TxN8nvxafiuR3jtoA0MbRvnwglS33rk3QbMqNsCiQLImG0/W66xqjV19K6grhfwD AlqUJsaCYjN5zXGbKnhU2NILH1WJY4NdRode91ySL0+AWbHPkXMma5iGK2Ffx3yKi/XZ T+Sz6URYk158ChhbwlBn2xdFZu/hLusu5uRMsboCZBz9uXj358Z5HlZQgKINcUQyuW4/ BNrg== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t2si6195490ybl.203.2020.12.14.07.58.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Dec 2020 07:58:32 -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; 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" Received: from localhost ([::1]:38978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koqF5-0007rb-V8 for patch@linaro.org; Mon, 14 Dec 2020 10:58:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koqEN-0007qv-4q; Mon, 14 Dec 2020 10:57:48 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:33011) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koqEJ-0001PG-V1; Mon, 14 Dec 2020 10:57:46 -0500 Received: from localhost.localdomain ([82.252.135.218]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MYNS0-1kbD5412tW-00VMqL; Mon, 14 Dec 2020 16:57:40 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 02/19] qemu-options.hx: Fix minor issues in icount documentation Date: Mon, 14 Dec 2020 16:57:16 +0100 Message-Id: <20201214155733.207430-3-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201214155733.207430-1-laurent@vivier.eu> References: <20201214155733.207430-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:p/tHvfoeP1YHaAepxycYGHCI5A2loL+jaiXRn5NyVdmTbPD5Cox BlhzuYkTjvnXpdxsd2XYOp1NJjhRjylIVbIM8fGiAMfZmubhMLr4XNvqmOK3Jx0eaCmE4iq Z4863uGqhJIX6WqdBjUMn95heeq3DATaDWOLcPZDEbqdmzQZwPC3fg2Oj13zavB1I3p38Up oP4rXZPei+71fSLw1d9Qw== X-UI-Out-Filterresults: notjunk:1; V03:K0:k6kugBOBskA=:D99hRrClOnKv3MnjhPzOhB kvAp76+FyYmT135dx2A48ObZUG9Qd3iB4jmkjLzqKa8We4waicij11Y8dyN5kKs2nUh7YYfyH klGKVtbrtAEPuqBfMisupfInhaEvzYmORojCs8rOgMlRI9nAc/Hhv5OyZWd5TTWA5BamdGyZi o2n/aUrcZmFeDtX3KsjkbO0KffdFPwLYTbQlPWWY6Fk6hf515IXppbj5lH2lW85rAlnJYAsL2 wndN4Jnccu/gDBUzwiJpmyfTc+O+qTJ4wKqZiGvSQdYU/YjmfJvzXoiNqxs4SQqk+fHOagPlB yt+xV0Vp6x3XTHPAJSl0D1FZyClKBXkVWN0szCOXiaCG/x4fidfQNP45KI2SqmBltSwX884cR H/Fm4bYUdNey40uGR4wHG309YsmcoxWi+klayqTnl0rV4rH2dOwR4i8bVU59RmWgbg6aZOep9 aKAsHt4Dhw== Received-SPF: none client-ip=212.227.17.10; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Peter Maydell , Richard Henderson , Michael Tokarev , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The documentation for the icount documentation has some minor issues: * in a couple of places it says "sleep=on|off" when in the context of the sentence it means specifically "sleep=on" * the synopsis line for the documentation has drifted out of sync with the synopsis line in the DEF() macro (used for "-help" output) * the synopsis line in the DEF() macro is missing a "][" between the sleep= part and the rr= part * the synopsis line doesn't indicate that rrsnapshot is an optional part of the rr=mode,rrfile=filename subgrouping * we don't document that sleep=on can't be used with shift=auto or align=on * the rr option description had some minor grammar and formatting errors and was a bit terse * in commit f1f4b57e88ff in 2015 the documentation of the sleep= suboption got added between the two paragraphs defining general behaviour of the icount option. This meant that the second paragraph talking about the behaviour of "this option" reads as if it's talking about sleep=on, when it's really describing -icount as a whole. The paragraph is better moved back up to above the sleep= section. * the summary text displayed in "-help" output didn't mention the record-and-replay part Fix these errors. Fixes: https://bugs.launchpad.net/qemu/+bug/1774412 Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-Id: <20201121213506.15599-1-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier --- qemu-options.hx | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) -- 2.29.2 diff --git a/qemu-options.hx b/qemu-options.hx index e60ad42976d0..ae8872d1d664 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3958,30 +3958,34 @@ SRST ERST DEF("icount", HAS_ARG, QEMU_OPTION_icount, \ - "-icount [shift=N|auto][,align=on|off][,sleep=on|off,rr=record|replay,rrfile=,rrsnapshot=]\n" \ + "-icount [shift=N|auto][,align=on|off][,sleep=on|off][,rr=record|replay,rrfile=[,rrsnapshot=]]\n" \ " enable virtual instruction counter with 2^N clock ticks per\n" \ " instruction, enable aligning the host and virtual clocks\n" \ - " or disable real time cpu sleeping\n", QEMU_ARCH_ALL) + " or disable real time cpu sleeping, and optionally enable\n" \ + " record-and-replay mode\n", QEMU_ARCH_ALL) SRST -``-icount [shift=N|auto][,rr=record|replay,rrfile=filename,rrsnapshot=snapshot]`` +``-icount [shift=N|auto][,align=on|off][,sleep=on|off][,rr=record|replay,rrfile=filename[,rrsnapshot=snapshot]]`` Enable virtual instruction counter. The virtual cpu will execute one instruction every 2^N ns of virtual time. If ``auto`` is specified then the virtual cpu speed will be automatically adjusted to keep virtual time within a few seconds of real time. - When the virtual cpu is sleeping, the virtual time will advance at - default speed unless ``sleep=on|off`` is specified. With - ``sleep=on|off``, the virtual time will jump to the next timer - deadline instantly whenever the virtual cpu goes to sleep mode and - will not advance if no timer is enabled. This behavior give - deterministic execution times from the guest point of view. - Note that while this option can give deterministic behavior, it does not provide cycle accurate emulation. Modern CPUs contain superscalar out of order cores with complex cache hierarchies. The number of instructions executed often has little or no correlation with actual performance. + When the virtual cpu is sleeping, the virtual time will advance at + default speed unless ``sleep=on`` is specified. With + ``sleep=on``, the virtual time will jump to the next timer + deadline instantly whenever the virtual cpu goes to sleep mode and + will not advance if no timer is enabled. This behavior gives + deterministic execution times from the guest point of view. + The default if icount is enabled is ``sleep=off``. + ``sleep=on`` cannot be used together with either ``shift=auto`` + or ``align=on``. + ``align=on`` will activate the delay algorithm which will try to synchronise the host clock and the virtual clock. The goal is to have a guest running at the real frequency imposed by the shift @@ -3991,15 +3995,17 @@ SRST ``shift`` is ``auto``. Note: The sync algorithm will work for those shift values for which the guest clock runs ahead of the host clock. Typically this happens when the shift value is high (how high - depends on the host machine). - - When ``rr`` option is specified deterministic record/replay is - enabled. Replay log is written into filename file in record mode and - read from this file in replay mode. - - Option rrsnapshot is used to create new vm snapshot named snapshot - at the start of execution recording. In replay mode this option is - used to load the initial VM state. + depends on the host machine). The default if icount is enabled + is ``align=off``. + + When the ``rr`` option is specified deterministic record/replay is + enabled. The ``rrfile=`` option must also be provided to + specify the path to the replay log. In record mode data is written + to this file, and in replay mode it is read back. + If the ``rrsnapshot`` option is given then it specifies a VM snapshot + name. In record mode, a new VM snapshot with the given name is created + at the start of execution recording. In replay mode this option + specifies the snapshot name used to load the initial VM state. ERST DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \ From patchwork Mon Dec 14 15:57:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 343561 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3116951jai; Mon, 14 Dec 2020 07:59:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuOURzNoMYrzhdfdO1As0LaS9GYIBhOXKaSEb6SRMQD/4ONLmbk++uN6LOPrzz0sNmTMjI X-Received: by 2002:a25:c052:: with SMTP id c79mr35023460ybf.287.1607961560429; Mon, 14 Dec 2020 07:59:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607961560; cv=none; d=google.com; s=arc-20160816; b=VQItPzc353aWUhWSzOUf0oQ1svAu84A3QpxQaUp/BNZ2y7TTlH4i7xVTVUfk7WuZkL 82Kak0FFxO1jYc/AuvWFRlprHxiP0PhmHA2z5my51M5msOdiWLNnkjHC/XpzvDNuAqEE 8qfCEA/Xla0wlpY4DI02xzkpIsR6vB4k043879hPWKD2Bj0OZR+GXHz4gvfoxn10dDQJ VCDy3II9+8ODv104YK5tK5IQaUhuQIVA5rOkO11hC2If1SElFhagcfCBldF3Yu/n+cfe cZdKgIOVQ7f3hYN6SQB7d5ORyxxSbonSzo0gpRY9DLc+HyqKbaC/QAIJLXDi5WNblxjs wKxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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; bh=hsBHK60M2awyIPHVTXwf8dDVIHsNyrVRg86aCqW4xfw=; b=M826YezgZ4EY+zpFO/DRnaZoilp859mHloAR9IV9cZ9S6CQhk67xFN1cFh//p5cJ0F Pod2Cvu/izPhimaNT8a2wmCqmGCQJJyhvbMckL2eT9GZ2en2tclpgA9ReTTPlvuaLtzO jiYnvUyy5PRI2acxYxI1P4Ua1t58bNCy4IEoWC2mnYPWyd1JBQ3w7tzIk4lNwmWL5fdv T4mKHAuNkn82hNVOOOkYL3zoQg54PLFcaQKNfDlEvMcNnvyC/3pjb5Z/Ize/reGhfbQi SqBS4HFPxzdZxFP19yqRVF+dXc0AJyWDQXHWVP6j5GOE1eONNLtbKRIK/e0T1Ruejk9o dt/g== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p10si17119359ybl.137.2020.12.14.07.59.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Dec 2020 07:59:20 -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; 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" Received: from localhost ([::1]:39046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koqFr-0007vd-Qi for patch@linaro.org; Mon, 14 Dec 2020 10:59:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koqEW-0007sO-Nl; Mon, 14 Dec 2020 10:57:58 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:34313) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koqEO-0001Pt-OF; Mon, 14 Dec 2020 10:57:54 -0500 Received: from localhost.localdomain ([82.252.135.218]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N33AR-1k7d620xjR-013Jx4; Mon, 14 Dec 2020 16:57:43 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 07/19] CODING_STYLE.rst: Be less strict about 80 character limit Date: Mon, 14 Dec 2020 16:57:21 +0100 Message-Id: <20201214155733.207430-8-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201214155733.207430-1-laurent@vivier.eu> References: <20201214155733.207430-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:dFbZeB9hYyMCoMAMNbQY5FhHlLjXOsmrd8vyeBmdGFee5Pa67VM DwhEamI1McOxEpbeLGGgL9YOJMZelWHTjSsEqqKCN+1QC/UwRBWndGw2QXVFMpYNP14Tevw ookrfu53ptHrKR/WArn436xheFPoUZfRFEziKX+V/LmKTuzZoayUeOMte9H7zAYOw2OH1GS w7rlV1tmlPNMwusAuKSZQ== X-UI-Out-Filterresults: notjunk:1; V03:K0:tjGLg8d8DO4=:whDlGGOSaQOPOOswEiCXqN NhvPS0JImLMEfIVNWqP8DFPGC0Uny4LRqgsUbVrsZQWE7pu+kZzphJEYxYsSYHYxx2tDz8SEI lUzUm4UhoDsGFfW5+ysXnKC1EtWU2C3nXhmzhAN8usNkpS7x4iomu50hEPLK8Z/DYcLukvm6f 5HK8TYJ9ETSa/JYz/wWhYJt/yPUFkdsdSYoY3Y6DsRUb3EKMzjAtO4t6CdFELdIH+BYfRfWnz lrO8wlcBQmzQyfyb1CjxnsRSnubRGxuwoAfi4b2YymNJNTqi0q5km8mWHsom838/P9+MwIJR1 IM7g0UaAZ4/zKmXeGqolXhaqyeyXhqGP8/DmjWefXFoD1D+LDjxFXIkTLdbQoyJ4PKOnxashi YvMk1czRMk9Z6C1UMCnF9wuhIEONS6G9c6YKmQdJcOir6X9A+yvQHKx7IAKMGe4WxUpG2/UMs NO3f5Z1Odw== Received-SPF: none client-ip=212.227.17.13; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S . Tsirkin" , qemu-trivial@nongnu.org, Michael Tokarev , Laurent Vivier , Markus Armbruster Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Relax the wording about line lengths a little bit; this goes with the checkpatch changes to warn at 100 characters rather than 80. (Compare the Linux kernel commit bdc48fa11e46f8; our coding style is not theirs, but the rationale is good and applies to us too.) Signed-off-by: Peter Maydell Reviewed-by: Markus Armbruster Reviewed-by: Michael S. Tsirkin Message-Id: <20201106112940.31300-1-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier --- CODING_STYLE.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.29.2 diff --git a/CODING_STYLE.rst b/CODING_STYLE.rst index 8b13ef0669eb..7bf4e39d4871 100644 --- a/CODING_STYLE.rst +++ b/CODING_STYLE.rst @@ -85,8 +85,13 @@ Line width Lines should be 80 characters; try not to make them longer. Sometimes it is hard to do, especially when dealing with QEMU subsystems -that use long function or symbol names. Even in that case, do not make -lines much longer than 80 characters. +that use long function or symbol names. If wrapping the line at 80 columns +is obviously less readable and more awkward, prefer not to wrap it; better +to have an 85 character line than one which is awkwardly wrapped. + +Even in that case, try not to make lines much longer than 80 characters. +(The checkpatch script will warn at 100 characters, but this is intended +as a guard against obviously-overlength lines, not a target.) Rationale: