@@ -998,13 +998,12 @@ static inline int64_t cpu_get_host_ticks(void)
}
#else
-/* The host CPU doesn't have an easily accessible cycle counter.
- Just return a monotonically increasing value. This will be
- totally wrong, but hopefully better than nothing. */
+/* The host CPU doesn't have an easily accessible cycle counter, so just return
+ the instruction count. This may make the CPU look like it has an IPC of
+ exactly 1, but that shouldn't cause any functional problems. */
static inline int64_t cpu_get_host_ticks (void)
{
- static int64_t ticks = 0;
- return ticks++;
+ return cpu_get_icount();
}
#endif
The previous increment-on-read fallback didn't increment fast enough for some versions of grub. https://bugs.launchpad.net/qemu-linaro/+bug/893208 Signed-off-by: Christopher Covington <cov@codeaurora.org> --- I unfortunately don't have the opportunity to fully test this right now, but I'm sending it out nevertheless on the off chance that someone else might. --- include/qemu/timer.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)