Skip to content

accel/tcg: Fix icount accounting on CPU reset

Philippe Mathieu-Daudé qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2accel/tcg: Extract icount_cpu_reset() helperaccel/tcg/icount-common.c hw/core/cpu-common.c include/exec/icount.h +1 more+13 -20 replies
2/2accel/tcg: Fix icount accounting on CPU resetaccel/tcg/icount-common.c tests/qtest/icount-x86-test.c tests/qtest/meson.build+131 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] accel/tcg: Fix icount accounting on CPU reset

When TCG runs with '-icount', resetting a vCPU from inside cpu_exec() can advance the virtual clock by the whole unused part of that vCPU's current instruction budget.

Fix by accounting the instructions executed so far immediately before the common CPU reset path clears the decrementer. Resets outside active cpu_exec() remain unchanged.

Philippe Mathieu-Daudé (2):
accel/tcg: Extract icount_cpu_reset() helper
accel/tcg: Fix icount accounting on CPU reset

 include/exec/icount.h         |   2 +
 accel/tcg/icount-common.c     |  16 +++++
 hw/core/cpu-common.c          |   4 +-
 stubs/icount.c                |   3 +
 tests/qtest/icount-x86-test.c | 119 ++++++++++++++++++++++++++++++++++
 tests/qtest/meson.build       |   2 +
 6 files changed, 144 insertions(+), 2 deletions(-)
 create mode 100644 tests/qtest/icount-x86-test.c
Signature · 1 line
2.55.0