From: Paolo Bonzini <pbonzini@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: pavel.dovgaluk@ispras.ru, boost.lists@gmail.com,
qemu-devel@nongnu.org, victor.clement@openwide.fr,
Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH v1 1/2] qemu-timer: gracefully handle the end of time
Date: Tue, 28 Jul 2020 18:58:22 +0200 [thread overview]
Message-ID: <859f63e1-684a-f8b8-22a5-770f6cbb150f@redhat.com> (raw)
In-Reply-To: <87o8nz39mt.fsf@linaro.org>
On 28/07/20 18:08, Alex Bennée wrote:
>
> Paolo Bonzini <pbonzini@redhat.com> writes:
>
>> On 28/07/20 16:10, Alex Bennée wrote:
>>> + /*
>>> + * Check to see if we have run out of time. Most of our time
>>> + * sources are nanoseconds since epoch (some time around the fall
>>> + * of Babylon 5, the start of the Enterprises five year mission
>>> + * and just before the arrival of the great evil ~ 2262CE).
>>> + * Although icount based time is ns since the start of emulation
>>> + * it is able to skip forward if the device is sleeping (think IoT
>>> + * device with a very long heartbeat). Either way we don't really
>>> + * handle running out of time so lets catch it and report it here.
>>> + */
>>> + if (current_time == INT64_MAX) {
>>> + qemu_handle_outa_time();
>>> + goto out;
>>> + }
>>> +
>>
>> Doing this here is a bit dangerous, I'd rather do nothing here and
>> detect the situation in cpus.c where we can do
>> qemu_system_shutdown_request() (and also do nothing).
>
> You mean in notify_aio_contexts()? Sure we can do that.
Yes, that would work. I think qemu_clock_deadline_ns_all would already
return -1 so that you'd have a zero-instruction budget from
tcg_get_icount_limit.
Paolo
next prev parent reply other threads:[~2020-07-28 16:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-28 14:10 [PATCH v1 0/2] clean-ups for sleep=off behaviour Alex Bennée
2020-07-28 14:10 ` [PATCH v1 1/2] qemu-timer: gracefully handle the end of time Alex Bennée
2020-07-28 14:42 ` Paolo Bonzini
2020-07-28 16:08 ` Alex Bennée
2020-07-28 16:58 ` Paolo Bonzini [this message]
2020-07-28 14:10 ` [PATCH v1 2/2] target/arm: only set the nexttick timer if !ISTATUS Alex Bennée
2020-07-28 14:16 ` Peter Maydell
2020-07-28 16:11 ` Alex Bennée
2020-07-28 16:23 ` Peter Maydell
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=859f63e1-684a-f8b8-22a5-770f6cbb150f@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=boost.lists@gmail.com \
--cc=pavel.dovgaluk@ispras.ru \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=victor.clement@openwide.fr \
/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).