[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v5 22/31] timer: introduce new QEMU_CLOCK_VI
From: |
Pavel Dovgaluk |
Subject: |
Re: [Qemu-devel] [RFC PATCH v5 22/31] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock |
Date: |
Fri, 28 Nov 2014 14:28:32 +0300 |
> From: Paolo Bonzini [mailto:address@hidden
> On 26/11/2014 11:40, Pavel Dovgalyuk wrote:
> > This patch introduces new QEMU_CLOCK_VIRTUAL_RT clock, which
> > should be used for icount warping. Separate timer is needed
> > for replaying the execution, because warping callbacks should
> > be deterministic. We cannot make realtime clock deterministic
> > because it is used for screen updates and other simulator-specific
> > actions. That is why we added new clock which is recorded and
> > replayed when needed.
> >
> > Signed-off-by: Pavel Dovgalyuk <address@hidden>
> > ---
> > include/qemu/timer.h | 7 +++++++
> > qemu-timer.c | 2 ++
> > replay/replay.h | 4 +++-
> > 3 files changed, 12 insertions(+), 1 deletions(-)
> >
> > diff --git a/include/qemu/timer.h b/include/qemu/timer.h
> > index 7b43331..df27157 100644
> > --- a/include/qemu/timer.h
> > +++ b/include/qemu/timer.h
> > @@ -37,12 +37,19 @@
> > * is suspended, and it will reflect system time changes the host may
> > * undergo (e.g. due to NTP). The host clock has the same precision as
> > * the virtual clock.
> > + *
> > + * @QEMU_CLOCK_VIRTUAL_RT: realtime clock used for icount warp
> > + *
> > + * This clock runs as a realtime clock, but is used for icount warp
> > + * and thus should be traced with record/replay to make warp function
> > + * behave deterministically.
> > */
>
> I think it should also stop/restart across "stop" and "cont" commands,
> similar to QEMU_CLOCK_VIRTUAL. This is as simple as changing
> get_clock() to cpu_get_clock().
Not so easy :)
cpu_get_clock() checks vm_clock_seqlock which is locked in icount_warp_rt().
And after locking it requests the value of QEMU_CLOCK_VIRTUAL_RT:
seqlock_write_lock(&timers_state.vm_clock_seqlock);
if (runstate_is_running()) {
int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT);
Pavel Dovgalyuk
- Re: [Qemu-devel] [RFC PATCH v5 20/31] replay: recording and replaying clock ticks, (continued)
[Qemu-devel] [RFC PATCH v5 21/31] replay: recording and replaying different timers, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 22/31] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock, Pavel Dovgalyuk, 2014/11/26
Re: [Qemu-devel] [RFC PATCH v5 22/31] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock,
Pavel Dovgaluk <=
Re: [Qemu-devel] [RFC PATCH v5 22/31] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock, Paolo Bonzini, 2014/11/28
[Qemu-devel] [RFC PATCH v5 23/31] cpus: make icount warp deterministic in replay mode, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 24/31] replay: shutdown event, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 25/31] replay: checkpoints, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 26/31] replay: bottom halves, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 27/31] replay: replay aio requests, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 28/31] replay: thread pool, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 29/31] replay: initialization and deinitialization, Pavel Dovgalyuk, 2014/11/26
[Qemu-devel] [RFC PATCH v5 30/31] replay: command line options, Pavel Dovgalyuk, 2014/11/26