Skip to content

exec: Rework around CPUState user fields (part 2)

Philippe Mathieu-Daudé qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest13 patches 6 repliesIn review
  2. v213 patches 4 repliesSuperseded
  3. v124 patches 28 repliesSuperseded

Changes in v3 from the cover letter

- Move cpu_loop_exit_requested() to "exec/cpu-loop.h"
- Added R-b tags

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13accel/tcg: Restrict qemu_plugin_vcpu_exit_hook() to TCG pluginshw/core/cpu-common.c+4 -00 replies
2/13accel/tcg: Restrict cpu_plugin_mem_cbs_enabled() to TCGaccel/tcg/internal-common.h include/hw/core/cpu.h+17 -170 replies
3/13accel/tcg: Move @plugin_mem_cbs from CPUState to CPUNegativeOffsetStateaccel/tcg/internal-common.h accel/tcg/plugin-gen.c include/hw/core/cpu.h +2 more+13 -110 replies
4/13accel/tcg: Move @plugin_state from CPUState to TCG AccelCPUStateaccel/tcg/plugin-gen.c accel/tcg/vcpu-state.h hw/core/cpu-common.c +2 more+14 -100 replies
5/13accel/tcg: Restrict cpu_loop_exit_requested() to TCGaccel/tcg/cpu-exec.c include/exec/cpu-loop.h include/exec/exec-all.h +2 more+38 -170 replies
6/13accel/tcg: Restrict IcountDecr / can_do_io / CPUTLB to TCGinclude/exec/tlb-common.h include/hw/core/cpu.h+10 -30 replies
7/13accel/tcg: Move @jmp_env from CPUState to TCG AccelCPUStateaccel/tcg/cpu-exec-common.c accel/tcg/cpu-exec.c accel/tcg/internal-common.h +3 more+8 -50 replies
8/13accel/tcg: Move @cflags_next_tb from CPUState to TCG AccelCPUStateaccel/tcg/cpu-exec.c accel/tcg/tb-maint.c accel/tcg/tcg-accel-ops.c +5 more+15 -130 replies
9/13accel/tcg: Move @iommu_notifiers from CPUState to TCG AccelCPUStateaccel/tcg/vcpu-state.h include/hw/core/cpu.h system/physmem.c+31 -120 replies
10/13accel/tcg: Move @tcg_cflags from CPUState to TCG AccelCPUStateaccel/tcg/cpu-exec.c accel/tcg/vcpu-state.h include/hw/core/cpu.h +1 more+7 -70 replies
11/13accel/tcg: Restrict icount to system emulationaccel/tcg/cpu-exec.c+6 -00 replies
12/13accel/tcg: Move icount fields from CPUState to TCG AccelCPUStateaccel/tcg/cpu-exec.c accel/tcg/icount-common.c accel/tcg/tcg-accel-ops-icount.c +4 more+23 -210 replies
13/13accel/tcg: Move @tb_jmp_cache from CPUState to TCG AccelCPUStateaccel/tcg/cpu-exec.c accel/tcg/cputlb.c accel/tcg/tb-jmp-cache.h +5 more+10 -170 replies

Reviews trailers per patch

All 13 patches have a Reviewed-by or Acked-by.

PatchRichard Henderson
1/13R-b
2/13R-b
3/13R-b
4/13R-b
5/13R-b
6/13R-b
7/13R-b
8/13R-b
9/13R-b
10/13R-b
11/13R-b
12/13R-b
13/13R-b

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

Read the v3 thread

Cover letter [PATCH v3 00/13] exec: Rework around CPUState user fields (part 2)

Missing WASM testing by Ilya (branch available at
https://gitlab.com/philmd/qemu/-/commits/tcg_flush_jmp_cache)

Since v2:
- Move cpu_loop_exit_requested() to "exec/cpu-loop.h"
- Added R-b tags

Since v1:
- First 13 patches queued
- Restrict qemu_plugin_vcpu_exit_hook() to (TCG) plugins
- Restrict cpu_plugin_mem_cbs_enabled() to TCG (plugins)
- Addressed Richard review comments on the others:
- Move cpu_plugin_mem_cbs_enabled()
- Do not move mem_io_pc, waiting for [*]
- Mention can_do_io restricted

Finish extracting TCG fields from CPUState:
- Extract tcg_cpu_exit() from cpu_exit()
- Introduce AccelOpsClass::exit_vcpu_thread()
- cpu_exit() calls exit_vcpu_thread=tcg_cpu_exit for TCG
- Forward declare TaskState and more uses of get_task_state()
- Introduce TCG AccelCPUState
- Move TCG specific fields from CPUState to AccelCPUState
- Restrict "exec/tlb-common.h" to TCG
- Restrict iommu_notifiers, icount to system emulation

[*] https://lore.kernel.org/qemu-devel/[email protected]/

Based-on: https://gitlab.com/philmd/qemu/-/commits/accel-next

Philippe Mathieu-Daudé (13):
accel/tcg: Restrict qemu_plugin_vcpu_exit_hook() to TCG plugins accel/tcg: Restrict cpu_plugin_mem_cbs_enabled() to TCG accel/tcg: Move @plugin_mem_cbs from CPUState to
CPUNegativeOffsetState
accel/tcg: Move @plugin_state from CPUState to TCG AccelCPUState accel/tcg: Restrict cpu_loop_exit_requested() to TCG accel/tcg: Restrict IcountDecr / can_do_io / CPUTLB to TCG accel/tcg: Move @jmp_env from CPUState to TCG AccelCPUState accel/tcg: Move @cflags_next_tb from CPUState to TCG AccelCPUState accel/tcg: Move @iommu_notifiers from CPUState to TCG AccelCPUState accel/tcg: Move @tcg_cflags from CPUState to TCG AccelCPUState accel/tcg: Restrict icount to system emulation accel/tcg: Move icount fields from CPUState to TCG AccelCPUState accel/tcg: Move @tb_jmp_cache from CPUState to TCG AccelCPUState

 accel/tcg/internal-common.h      | 18 ++++++++++
 accel/tcg/tb-jmp-cache.h         |  4 +--
 accel/tcg/tcg-accel-ops.h        |  1 +
 accel/tcg/vcpu-state.h           | 20 +++++++++++
 include/exec/cpu-loop.h          | 35 +++++++++++++++++++
 include/exec/exec-all.h          | 17 ----------
 include/exec/tlb-common.h        |  4 +++
 include/hw/core/cpu.h            | 58 ++++++++------------------------
 include/qemu/plugin.h            |  2 +-
 include/qemu/typedefs.h          |  1 -
 accel/tcg/cpu-exec-common.c      |  2 +-
 accel/tcg/cpu-exec.c             | 52 +++++++++++++++-------------
 accel/tcg/cputlb.c               |  2 +-
 accel/tcg/icount-common.c        |  7 ++--
 accel/tcg/plugin-gen.c           |  9 +++--
 accel/tcg/tb-maint.c             |  6 ++--
 accel/tcg/tcg-accel-ops-icount.c | 14 ++++----
 accel/tcg/tcg-accel-ops.c        |  2 ++
 accel/tcg/translate-all.c        |  9 ++---
 accel/tcg/watchpoint.c           |  5 +--
 hw/core/cpu-common.c             |  9 +++--
 linux-user/main.c                |  2 +-
 plugins/core.c                   |  9 ++---
 system/physmem.c                 | 37 +++++++++++++++-----
 target/arm/tcg/helper-a64.c      |  1 +
 target/s390x/tcg/mem_helper.c    |  1 +
 26 files changed, 195 insertions(+), 132 deletions(-)
 create mode 100644 include/exec/cpu-loop.h
Signature · 1 line
2.41.0