Skip to content

accel: Restrict TCG plugin (un)registration to TCG accel

Philippe Mathieu-Daudé qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6system/runstate: Remove unused 'qemu/plugin.h' headersystem/runstate.c+0 -10 replies
2/6accel/tcg: Move common declarations to 'internal-common.h'accel/tcg/internal-common.h accel/tcg/internal-target.h accel/tcg/tcg-all.c+16 -150 replies
3/6accel: Clarify accel_cpu_common_[un]realize() use unassigned vCPUaccel/accel-target.c accel/tcg/cpu-exec.c accel/tcg/internal-common.h +3 more+25 -190 replies
4/6accel: Introduce accel_cpu_common_[un]realize_assigned() handlersaccel/accel-target.c cpu-target.c include/qemu/accel.h+49 -00 replies
5/6accel: Restrict TCG plugin (un)registration to TCG accelaccel/tcg/cpu-exec-common.c accel/tcg/internal-common.h accel/tcg/tcg-all.c +2 more+31 -310 replies
6/6accel/tcg: Move qemu_plugin_vcpu_init__async() to plugins/accel/tcg/cpu-exec-common.c plugins/core.c+9 -100 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchRichard HendersonPierrick Bouvier
SeriesR-b R-b
1/6
2/6
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] accel: Restrict TCG plugin (un)registration to TCG accel

Hi,

TL;DR; this series remove TCG plugin code from generic accel code.

Since the introduction of the scoreboard in plugins, the INIT hook use the vCPU index, which is only available somewhere during the vCPU REALIZE() step (see below for call tree).

In order to clarify that, we split accel_cpu_common_[un]realize as *unassigned and *assigned steps. This allow to remove the plugin [un]registration code from common accel code.

Another approach suggested by rth is to add a PostRealize() handler in DeviceClass. This was already experimented here:
https://lore.kernel.org/qemu-devel/[email protected]/
Since it is a change harder to sell, I took this simplified path which just make the vCPU REALIZE a bit more complex, but not really an concern since the current call tree is
https://etherpad.opendev.org/p/QEMU_vCPU_life.

Philippe Mathieu-Daudé (6):
system/runstate: Remove unused 'qemu/plugin.h' header accel/tcg: Move common declarations to 'internal-common.h'
accel: Clarify accel_cpu_common_[un]realize() use unassigned vCPU
accel: Introduce accel_cpu_common_[un]realize_assigned() handlers
accel: Restrict TCG plugin (un)registration to TCG accel accel/tcg: Move qemu_plugin_vcpu_init__async() to plugins/

 accel/tcg/internal-common.h | 17 ++++++++++++++++
 accel/tcg/internal-target.h | 14 -------------
 include/qemu/accel.h        | 39 ++++++++++++++++++++++++++++++-------
 include/qemu/plugin.h       |  6 ------
 accel/accel-target.c        | 34 +++++++++++++++++++++++++++-----
 accel/tcg/cpu-exec-common.c | 20 +++++++++++++++++++
 accel/tcg/cpu-exec.c        |  4 ++--
 accel/tcg/tcg-all.c         |  8 +++++---
 cpu-target.c                | 10 ++++++++--
 hw/core/cpu-common.c        | 25 ------------------------
 plugins/core.c              |  8 +++++++-
 system/runstate.c           |  1 -
 12 files changed, 120 insertions(+), 66 deletions(-)
Signature · 1 line
2.41.0