From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: qemu-devel@nongnu.org
Cc: berrange@redhat.com, richard.henderson@linaro.org,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
peter.maydell@linaro.org, philmd@linaro.org
Subject: Re: [PATCH v2 0/2] control guest time using a dilation factor
Date: Mon, 4 Aug 2025 09:19:04 -0700 [thread overview]
Message-ID: <327b7306-de98-40db-a2e4-27b4c9806a5a@linaro.org> (raw)
In-Reply-To: <20250628002431.41823-1-pierrick.bouvier@linaro.org>
On 6/27/25 5:24 PM, Pierrick Bouvier wrote:
> Depending on host cpu speed, and QEMU optimization level, it may sometimes be
> needed to slow or accelerate time guest is perceiving. A common scenario is
> hitting a timeout during a boot process, because some operations were not
> finished on time.
>
> An existing solution for that is -icount shift=X, with low values, which will
> roughly map virtual time to how many instructions were executed.
>
> This series introduces another approach, based on faking host time returned to
> the guest, by applying a time-dilation factor. Time will go slower/faster for
> the guest, without impacting QEMU emulation speed.
>
> It may eventually be used to fix some of the timeouts we hit in CI, by slowing
> down time in VM, to be less sensitive to varying cpu performance.
>
> v2
> --
>
> In review, Paolo mentioned timers deadline should redilated in the other
> direction. After going through this part, it seems that arrival is always based
> on one of the clocks we have (which is dilated already), so I don't think we
> should redilate that, as this would create a discordance between time set, and
> real time when this happen. Feel free to correct me if this is wrong.
>
> - keep start time per clock and apply accordingly
> - apply time dilation for cpu_get_host_ticks as well
> - use a default factor of 1.0
> - rename cli option to -rtc speed-factor
> - forbid to use option with kvm, as time is not provided by QEMU for guest
>
> Pierrick Bouvier (2):
> qemu/timer: introduce time dilation factor
> system/rtc: introduce -rtc speed-factor option
>
> include/qemu/timer.h | 60 ++++++++++++++++++++++++++++------------
> system/rtc.c | 11 ++++++++
> system/vl.c | 9 ++++++
> util/qemu-timer-common.c | 7 +++++
> qemu-options.hx | 7 ++++-
> 5 files changed, 75 insertions(+), 19 deletions(-)
>
Trying another ping on this series.
It has been useful to reduce number of interruptions in a guest when
running on a slow machine.
Regards,
Pierrick
prev parent reply other threads:[~2025-08-04 18:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-28 0:24 [PATCH v2 0/2] control guest time using a dilation factor Pierrick Bouvier
2025-06-28 0:24 ` [PATCH v2 1/2] qemu/timer: introduce time " Pierrick Bouvier
2025-06-28 0:24 ` [PATCH v2 2/2] system/rtc: introduce -rtc speed-factor option Pierrick Bouvier
2025-07-08 17:43 ` [PATCH v2 0/2] control guest time using a dilation factor Pierrick Bouvier
2025-07-21 16:42 ` Pierrick Bouvier
2025-08-04 16:19 ` Pierrick Bouvier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=327b7306-de98-40db-a2e4-27b4c9806a5a@linaro.org \
--to=pierrick.bouvier@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).