qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/18] TCG Plugin inline operation enhancement
@ 2024-02-13  9:39 Pierrick Bouvier
  2024-02-13  9:39 ` [PATCH v4 01/18] plugins: remove previous n_vcpus functions from API Pierrick Bouvier
                   ` (18 more replies)
  0 siblings, 19 replies; 30+ messages in thread
From: Pierrick Bouvier @ 2024-02-13  9:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, Yanan Wang, Marcel Apfelbaum, Paolo Bonzini,
	Mahmoud Mandour, Pierrick Bouvier, Alexandre Iooss,
	Philippe Mathieu-Daudé, Eduardo Habkost, Richard Henderson

This series adds a new thread-safe API to declare inline operation
inside plugins. As well, it removes the existing non thread-safe API,
and migrates all existing plugins to use it.

Tested on Linux (user, system) for i386, x86_64 and aarch64.

To give some context, this a long term series of work around plugins,
with the goal to be able to do basic operations in a more performant and
accurate way. This will mean to add more inline operations and
conditional callbacks.

One final target of this work is to implement a plugin that implements
the icount=auto feature, and allow QEMU to run at a given "frequency"
based on number of instructions executed, without QEMU needing to keep
track of this.

Another final target is to be able to detect control flow changes in an
efficient and elegant way, by combining inline operation and conditional
callbacks.

v2
--

Implement scoreboard API (cpu local storage), so plugins don't have to deal
with how many cpus are used.

Since plugins have been modified again, I didn't transfer any reviewed-by on
those commits.

v3
--

- introduce qemu_plugin_num_vcpus (how many cpus were initialized)
- fix order of plugin init/idle/resume callbacks
- scoreboard:
  - renamed qemu_plugin_u64_t -> qemu_plugin_u64
  - some functions rename for scoreboard api
  - qemu_plugin_u64 has only value based function (vs address before)
- various cleanup thanks to review of previous series

v4
--

- split scoreboard/qemu_plugin_u64 patches
- use list instead of hash table to keep track of scoreboards
- remove immediate in tcg code gen

Based-on: 20240122145610.413836-1-alex.bennee@linaro.org

 Version number: 4
 Branches:
          base:  plugin_registers_v3_20240122145610.413836-1-alex.bennee@linaro.org
          topic: plugin_inline_per_vcpu

Pierrick Bouvier (18):
  plugins: remove previous n_vcpus functions from API
  plugins: add qemu_plugin_num_vcpus function
  plugins: fix order of init/idle/resume callback
  cpu: call plugin init hook asynchronously
  plugins: scoreboard API
  plugins: define qemu_plugin_u64
  docs/devel: plugins can trigger a tb flush
  plugins: implement inline operation relative to cpu_index
  plugins: add inline operation per vcpu
  tests/plugin: add test plugin for inline operations
  tests/plugin/mem: migrate to new per_vcpu API
  tests/plugin/insn: migrate to new per_vcpu API
  tests/plugin/bb: migrate to new per_vcpu API
  contrib/plugins/hotblocks: migrate to new per_vcpu API
  contrib/plugins/howvec: migrate to new per_vcpu API
  plugins: remove non per_vcpu inline operation from API
  plugins: cleanup codepath for previous inline operation
  MAINTAINERS: Add myself as reviewer for TCG Plugins

 MAINTAINERS                     |   1 +
 docs/devel/multi-thread-tcg.rst |   1 +
 include/qemu/plugin.h           |   7 ++
 include/qemu/qemu-plugin.h      | 151 ++++++++++++++++++++------
 plugins/plugin.h                |  23 ++--
 accel/tcg/plugin-gen.c          |  69 +++++++++---
 contrib/plugins/cache.c         |   2 +-
 contrib/plugins/hotblocks.c     |  50 +++++----
 contrib/plugins/howvec.c        |  53 ++++++---
 hw/core/cpu-common.c            |   9 +-
 plugins/api.c                   | 121 +++++++++++++--------
 plugins/core.c                  |  94 ++++++++++++++--
 tests/plugin/bb.c               |  63 +++++------
 tests/plugin/inline.c           | 186 ++++++++++++++++++++++++++++++++
 tests/plugin/insn.c             | 106 +++++++++---------
 tests/plugin/mem.c              |  40 ++++---
 plugins/qemu-plugins.symbols    |  16 ++-
 tests/plugin/meson.build        |   2 +-
 18 files changed, 737 insertions(+), 257 deletions(-)
 create mode 100644 tests/plugin/inline.c

-- 
2.43.0



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

end of thread, other threads:[~2024-02-16 16:21 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13  9:39 [PATCH v4 00/18] TCG Plugin inline operation enhancement Pierrick Bouvier
2024-02-13  9:39 ` [PATCH v4 01/18] plugins: remove previous n_vcpus functions from API Pierrick Bouvier
2024-02-13 18:07   ` Richard Henderson
2024-02-13  9:39 ` [PATCH v4 02/18] plugins: add qemu_plugin_num_vcpus function Pierrick Bouvier
2024-02-13 18:10   ` Richard Henderson
2024-02-13  9:39 ` [PATCH v4 03/18] plugins: fix order of init/idle/resume callback Pierrick Bouvier
2024-02-13  9:39 ` [PATCH v4 04/18] cpu: call plugin init hook asynchronously Pierrick Bouvier
2024-02-13  9:39 ` [PATCH v4 05/18] plugins: scoreboard API Pierrick Bouvier
2024-02-13 18:23   ` Richard Henderson
2024-02-13  9:39 ` [PATCH v4 06/18] plugins: define qemu_plugin_u64 Pierrick Bouvier
2024-02-13 18:29   ` Richard Henderson
2024-02-13  9:39 ` [PATCH v4 07/18] docs/devel: plugins can trigger a tb flush Pierrick Bouvier
2024-02-13 18:33   ` Richard Henderson
2024-02-13  9:39 ` [PATCH v4 08/18] plugins: implement inline operation relative to cpu_index Pierrick Bouvier
2024-02-13  9:39 ` [PATCH v4 09/18] plugins: add inline operation per vcpu Pierrick Bouvier
2024-02-13 18:42   ` Richard Henderson
2024-02-13  9:40 ` [PATCH v4 10/18] tests/plugin: add test plugin for inline operations Pierrick Bouvier
2024-02-13  9:40 ` [PATCH v4 11/18] tests/plugin/mem: migrate to new per_vcpu API Pierrick Bouvier
2024-02-13  9:40 ` [PATCH v4 12/18] tests/plugin/insn: " Pierrick Bouvier
2024-02-13  9:40 ` [PATCH v4 13/18] tests/plugin/bb: " Pierrick Bouvier
2024-02-13  9:40 ` [PATCH v4 14/18] contrib/plugins/hotblocks: " Pierrick Bouvier
2024-02-13  9:40 ` [PATCH v4 15/18] contrib/plugins/howvec: " Pierrick Bouvier
2024-02-13  9:40 ` [PATCH v4 16/18] plugins: remove non per_vcpu inline operation from API Pierrick Bouvier
2024-02-13 18:44   ` Richard Henderson
2024-02-14  9:56     ` Pierrick Bouvier
2024-02-13  9:40 ` [PATCH v4 17/18] plugins: cleanup codepath for previous inline operation Pierrick Bouvier
2024-02-13 18:45   ` Richard Henderson
2024-02-13  9:40 ` [PATCH v4 18/18] MAINTAINERS: Add myself as reviewer for TCG Plugins Pierrick Bouvier
2024-02-13 18:45   ` Richard Henderson
2024-02-16 16:20 ` [PATCH v4 00/18] TCG Plugin inline operation enhancement 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).