mbox series

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

Message ID 20240528145953.65398-1-philmd@linaro.org (mailing list archive)
Headers show
Series accel: Restrict TCG plugin (un)registration to TCG accel | expand

Message

Philippe Mathieu-Daudé May 28, 2024, 2:59 p.m. UTC
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/20240209123226.32576-1-philmd@linaro.org/
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(-)

Comments

Richard Henderson May 28, 2024, 6:15 p.m. UTC | #1
On 5/28/24 07:59, Philippe Mathieu-Daudé wrote:
> 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/

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Pierrick Bouvier May 28, 2024, 6:55 p.m. UTC | #2
On 5/28/24 07:59, Philippe Mathieu-Daudé wrote: > 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/
>

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>