Skip to content

Commit

Permalink
Revert "Use clock_gettime(CLOCK_VIRTUAL,...) for QEMU_CLOCK_VIRTUAL."
Browse files Browse the repository at this point in the history
This reverts commit abef7fd.

With the origional commit applied, the system failes to progress past
ATA probing and all jenkins test runs failed with timeouts over the
weekend.
  • Loading branch information
brooksdavis committed May 15, 2017
1 parent bbee5bc commit 12871eb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cpus.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static int64_t cpu_get_clock_locked(void)

ticks = timers_state.cpu_clock_offset;
if (timers_state.cpu_ticks_enabled) {
ticks += get_virtual_clock();
ticks += get_clock();
}

return ticks;
Expand Down
18 changes: 0 additions & 18 deletions include/qemu/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -825,11 +825,6 @@ static inline int64_t get_clock(void)
return muldiv64(ti.QuadPart, get_ticks_per_sec(), clock_freq);
}

static inline int64_t get_virtual_clock(void)
{
return get_clock();
}

#else

extern int use_rt_clock;
Expand All @@ -849,19 +844,6 @@ static inline int64_t get_clock(void)
return get_clock_realtime();
}
}

static inline int64_t get_virtual_clock(void)
{
#ifdef CLOCK_VIRTUAL
struct timespec ts;

clock_gettime(CLOCK_VIRTUAL, &ts);
return ts.tv_sec * 1000000000LL + ts.tv_nsec;
#else
return get_clock();
#endif
}

#endif

/* icount */
Expand Down
2 changes: 1 addition & 1 deletion qemu-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ int64_t qemu_clock_get_ns(QEMUClockType type)
default:
case QEMU_CLOCK_VIRTUAL:
if (use_icount) {
return cpu_get_icount();
return (cpu_get_icount() << 4) | (cpu_get_clock() & 0xful);
} else {
return cpu_get_clock();
}
Expand Down

0 comments on commit 12871eb

Please sign in to comment.