cpu-timers, icount: new modules
commit740b175973427bcfa32ad894bb1f83b96d184c28
authorClaudio Fontana <cfontana@suse.de>
Wed, 19 Aug 2020 11:17:19 +0000 (19 13:17 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 5 Oct 2020 14:41:22 +0000 (5 16:41 +0200)
tree3613e83be5fd8620b369479b98e6ede5d5746a9a
parent0ac0b47c44b4be6cbce26777a1a5968cc8f025a5
cpu-timers, icount: new modules

refactoring of cpus.c continues with cpu timer state extraction.

cpu-timers: responsible for the softmmu cpu timers state,
            including cpu clocks and ticks.

icount: counts the TCG instructions executed. As such it is specific to
the TCG accelerator. Therefore, it is built only under CONFIG_TCG.

One complication is due to qtest, which uses an icount field to warp time
as part of qtest (qtest_clock_warp).

In order to solve this problem, provide a separate counter for qtest.

This requires fixing assumptions scattered in the code that
qtest_enabled() implies icount_enabled(), checking each specific case.

Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
[remove redundant initialization with qemu_spice_init]
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
[fix lingering calls to icount_get]
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
37 files changed:
MAINTAINERS
accel/qtest.c
accel/tcg/cpu-exec.c
accel/tcg/tcg-all.c
accel/tcg/translate-all.c
dma-helpers.c
exec.c
hw/core/ptimer.c
hw/i386/x86.c
include/exec/cpu-all.h
include/exec/exec-all.h
include/qemu/timer.h
include/sysemu/cpu-timers.h [new file with mode: 0644]
include/sysemu/cpus.h
include/sysemu/qtest.h
replay/replay.c
softmmu/cpu-timers.c [new file with mode: 0644]
softmmu/cpus.c
softmmu/icount.c [new file with mode: 0644]
softmmu/meson.build
softmmu/qtest.c
softmmu/timers-state.h [new file with mode: 0644]
softmmu/vl.c
stubs/clock-warp.c [deleted file]
stubs/cpu-get-clock.c
stubs/cpu-get-icount.c [deleted file]
stubs/icount.c [new file with mode: 0644]
stubs/meson.build
stubs/qemu-timer-notify-cb.c
stubs/qtest.c
target/alpha/translate.c
target/arm/helper.c
target/riscv/csr.c
tests/ptimer-test-stubs.c
tests/test-timed-average.c
util/main-loop.c
util/qemu-timer.c