[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V5 3/6] icount: Make icount_time_shift available eve
From: |
Sebastian Tanase |
Subject: |
[Qemu-devel] [PATCH V5 3/6] icount: Make icount_time_shift available everywhere |
Date: |
Fri, 25 Jul 2014 11:56:30 +0200 |
icount_time_shift is used for calculting the delay
qemu has to sleep in order to synchronise the
host and guest clocks. Therefore, we need it in
cpu-exec.c.
Signed-off-by: Sebastian Tanase <address@hidden>
Tested-by: Camille Bégué <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
cpus.c | 8 ++++++--
include/qemu-common.h | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/cpus.c b/cpus.c
index 34cc4c8..de0a8b2 100644
--- a/cpus.c
+++ b/cpus.c
@@ -105,8 +105,12 @@ static bool all_cpu_threads_idle(void)
/* Compensate for varying guest execution speed. */
static int64_t qemu_icount_bias;
static int64_t vm_clock_warp_start;
-/* Conversion factor from emulated instructions to virtual clock ticks. */
-static int icount_time_shift;
+/* Conversion factor from emulated instructions to virtual clock ticks.
+ * icount_time_shift is defined as extern in include/qemu-common.h because
+ * it is used (in cpu-exec.c) for calculating the delay for sleeping
+ * qemu in order to align the host and virtual clocks.
+ */
+int icount_time_shift;
/* Arbitrarily pick 1MIPS as the minimum allowable speed. */
#define MAX_ICOUNT_SHIFT 10
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 860bb15..d47aa02 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -109,6 +109,7 @@ static inline char *realpath(const char *path, char
*resolved_path)
void configure_icount(QemuOpts *opts, Error **errp);
extern int use_icount;
extern int icount_align_option;
+extern int icount_time_shift;
#include "qemu/osdep.h"
#include "qemu/bswap.h"
--
2.0.0.rc2
- [Qemu-devel] [PATCH V5 0/6] icount: Implement delay algorithm between guest and host clocks, Sebastian Tanase, 2014/07/25
- [Qemu-devel] [PATCH V5 1/6] icount: Add QemuOpts for icount, Sebastian Tanase, 2014/07/25
- [Qemu-devel] [PATCH V5 3/6] icount: Make icount_time_shift available everywhere,
Sebastian Tanase <=
- [Qemu-devel] [PATCH V5 2/6] icount: Add align option to icount, Sebastian Tanase, 2014/07/25
- [Qemu-devel] [PATCH V5 6/6] monitor: Add drift info to 'info jit', Sebastian Tanase, 2014/07/25
- [Qemu-devel] [PATCH V5 4/6] cpu_exec: Add sleeping algorithm, Sebastian Tanase, 2014/07/25
- [Qemu-devel] [PATCH V5 5/6] cpu_exec: Print to console if the guest is late, Sebastian Tanase, 2014/07/25
- Re: [Qemu-devel] [PATCH V5 0/6] icount: Implement delay algorithm between guest and host clocks, Andreas Färber, 2014/07/25