@@ -79,12 +79,14 @@ int64_t replay_save_clock(ReplayClockKind kind, int64_t clock,
int64_t replay_read_clock(ReplayClockKind kind, int64_t raw_icount);
/*! Saves or reads the clock depending on the current replay mode. */
#define REPLAY_CLOCK(clock, value) \
+ !icount_enabled() ? (value) : \
(replay_mode == REPLAY_MODE_PLAY \
? replay_read_clock((clock), icount_get_raw()) \
: replay_mode == REPLAY_MODE_RECORD \
? replay_save_clock((clock), (value), icount_get_raw()) \
: (value))
#define REPLAY_CLOCK_LOCKED(clock, value) \
+ !icount_enabled() ? (value) : \
(replay_mode == REPLAY_MODE_PLAY \
? replay_read_clock((clock), icount_get_raw_locked()) \
: replay_mode == REPLAY_MODE_RECORD \
@@ -1,5 +1,4 @@
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "sysemu/cpu-timers.h"
/* icount - Instruction Counter API */
@@ -10,11 +9,6 @@ void icount_update(CPUState *cpu)
{
abort();
}
-void icount_configure(QemuOpts *opts, Error **errp)
-{
- /* signal error */
- error_setg(errp, "cannot configure icount, TCG support not available");
-}
int64_t icount_get_raw(void)
{
abort();
@@ -2270,7 +2270,11 @@ static void user_register_global_props(void)
static int do_configure_icount(void *opaque, QemuOpts *opts, Error **errp)
{
- icount_configure(opts, errp);
+ if (tcg_enabled()) {
+ icount_configure(opts, errp);
+ } else {
+ error_setg(errp, "cannot configure icount, TCG support not available");
+ }
return 0;
}
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- include/sysemu/replay.h | 2 ++ stubs/icount.c | 6 ------ system/vl.c | 6 +++++- 3 files changed, 7 insertions(+), 7 deletions(-)