[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v6 20/32] timer: introduce new QEMU_CLOCK_VIRTUA
From: |
Pavel Dovgalyuk |
Subject: |
[Qemu-devel] [RFC PATCH v6 20/32] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock |
Date: |
Mon, 08 Dec 2014 10:54:52 +0300 |
User-agent: |
StGit/0.16 |
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 ++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index 3dae414..5948c88 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -36,12 +36,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.
*/
typedef enum {
QEMU_CLOCK_REALTIME = 0,
QEMU_CLOCK_VIRTUAL = 1,
QEMU_CLOCK_HOST = 2,
+ QEMU_CLOCK_VIRTUAL_RT = 3,
QEMU_CLOCK_MAX
} QEMUClockType;
diff --git a/qemu-timer.c b/qemu-timer.c
index 00a5d35..f4b4b6a 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -566,6 +566,8 @@ int64_t qemu_clock_get_ns(QEMUClockType type)
notifier_list_notify(&clock->reset_notifiers, &now);
}
return now;
+ case QEMU_CLOCK_VIRTUAL_RT:
+ return cpu_get_clock();
}
}
- [Qemu-devel] [RFC PATCH v6 10/32] i386: do not cross the pages boundaries in replay mode, (continued)
- [Qemu-devel] [RFC PATCH v6 10/32] i386: do not cross the pages boundaries in replay mode, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 11/32] From 7abf2f72777958d395cfd01d97fe707cc06152b5 Mon Sep 17 00:00:00 2001, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 12/32] From 185a3a47d08857a66332ae862b372a153ce92bb9 Mon Sep 17 00:00:00 2001, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 13/32] From a0cb9e80ba0de409b5ad556109a1c71ce4d8ce19 Mon Sep 17 00:00:00 2001, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 14/32] From 04bbd21134dd2c6b7309a7f5f2b780aae2757003 Mon Sep 17 00:00:00 2001, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 15/32] cpu-exec: allow temporary disabling icount, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 16/32] cpu-exec: invalidate nocache translation if they are interrupted, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 17/32] cpu: replay instructions sequence, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 18/32] replay: interrupts and exceptions, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 19/32] replay: asynchronous events infrastructure, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 20/32] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock,
Pavel Dovgalyuk <=
- [Qemu-devel] [RFC PATCH v6 21/32] cpus: make icount warp deterministic in replay mode, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 22/32] timer: fix usage of clock functions, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 24/32] replay: recording and replaying different timers, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 25/32] replay: shutdown event, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 23/32] replay: recording and replaying clock ticks, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 26/32] replay: checkpoints, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 27/32] replay: bottom halves, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 28/32] replay: replay aio requests, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 29/32] replay: thread pool, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 30/32] replay: initialization and deinitialization, Pavel Dovgalyuk, 2014/12/08