qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Implement icount=auto using TCG Plugins
@ 2024-05-16 22:20 Pierrick Bouvier
  2024-05-16 22:20 ` [PATCH 1/5] sysemu: add set_virtual_time to accel ops Pierrick Bouvier
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2024-05-16 22:20 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Laurent Vivier, Mahmoud Mandour, Alex Bennée,
	Alexandre Iooss, Richard Henderson, Pierrick Bouvier,
	Paolo Bonzini

The goal here is to be able to scale temporally execution of qemu-user/system,
using a given number of instructions per second.

We define a virtual clock, that can be late or in advance compared to real time.
When we are in advance, we slow execution (by sleeping) until catching real
time.

Finally, we should be able to cleanup icount=auto mode completely, and keep
icount usage for determistic purposes only.

It is built upon new TCG Plugins inline ops (store + conditional callbacks), now
merged on master.

Example in user-mode:

- Retrieve number of instructions to execute /bin/true
$ ./build/qemu-x86_64 -plugin ./build/tests/plugin/libinsn.so -d plugin /bin/true
cpu 0 insns: 120546
total insns: 120546
- Slow execution to match 5 seconds
$ time ./build/qemu-x86_64 -plugin ./build/contrib/plugins/libips,ips=$((120546/5)) /bin/true
real    0m4.985s

Alex Bennée (4):
  sysemu: add set_virtual_time to accel ops
  qtest: use cpu interface in qtest_clock_warp
  sysemu: generalise qtest_warp_clock as qemu_clock_advance_virtual_time
  plugins: add time control API

Pierrick Bouvier (1):
  contrib/plugins: add ips plugin example for cost modeling

 include/qemu/qemu-plugin.h                    |  23 ++
 include/qemu/timer.h                          |  15 ++
 include/sysemu/accel-ops.h                    |  18 +-
 include/sysemu/cpu-timers.h                   |   3 +-
 include/sysemu/qtest.h                        |   1 +
 accel/qtest/qtest.c                           |   1 +
 contrib/plugins/ips.c                         | 239 ++++++++++++++++++
 plugins/api.c                                 |  31 +++
 ...t-virtual-clock.c => cpus-virtual-clock.c} |   5 +
 system/cpus.c                                 |  11 +
 system/qtest.c                                |  27 +-
 util/qemu-timer.c                             |  26 ++
 contrib/plugins/Makefile                      |   1 +
 plugins/qemu-plugins.symbols                  |   2 +
 stubs/meson.build                             |   6 +-
 15 files changed, 383 insertions(+), 26 deletions(-)
 create mode 100644 contrib/plugins/ips.c
 rename stubs/{cpus-get-virtual-clock.c => cpus-virtual-clock.c} (68%)

-- 
2.39.2



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-05-30 17:42 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-16 22:20 [PATCH 0/5] Implement icount=auto using TCG Plugins Pierrick Bouvier
2024-05-16 22:20 ` [PATCH 1/5] sysemu: add set_virtual_time to accel ops Pierrick Bouvier
2024-05-28 17:11   ` Alex Bennée
2024-05-28 18:57     ` Pierrick Bouvier
2024-05-29 12:29   ` Philippe Mathieu-Daudé
2024-05-29 18:57     ` Pierrick Bouvier
2024-05-30  6:30   ` Paolo Bonzini
2024-05-30 17:18     ` Pierrick Bouvier
2024-05-16 22:20 ` [PATCH 2/5] qtest: use cpu interface in qtest_clock_warp Pierrick Bouvier
2024-05-30  6:32   ` Paolo Bonzini
2024-05-30 17:41     ` Pierrick Bouvier
2024-05-16 22:20 ` [PATCH 3/5] sysemu: generalise qtest_warp_clock as qemu_clock_advance_virtual_time Pierrick Bouvier
2024-05-16 22:20 ` [PATCH 4/5] plugins: add time control API Pierrick Bouvier
2024-05-16 22:20 ` [PATCH 5/5] contrib/plugins: add ips plugin example for cost modeling Pierrick Bouvier
2024-05-28 19:14   ` Alex Bennée
2024-05-28 19:26     ` Pierrick Bouvier
2024-05-28 19:57       ` Alex Bennée
2024-05-28 20:26         ` Pierrick Bouvier
2024-05-29 12:13           ` Alex Bennée
2024-05-29 14:33             ` Pierrick Bouvier
2024-05-29 15:39               ` Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).