Skip to content

RFC qemu: Introduce TargetInfo API (for single binary)

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest19 patches 31 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19qemu: Introduce TargetInfo API in 'target_info.h'include/exec/poison.h include/qemu/target_info-impl.h include/qemu/target_info.h +3 more+88 -01 reply
2/19qemu: Convert target_name() to TargetInfo APIcpu-target.c hw/core/machine-qmp-cmds.c include/hw/core/cpu.h +6 more+14 -91 reply
3/19qemu: Factor target_system_arch() outhw/core/machine-qmp-cmds.c include/qemu/target_info-impl.h include/qemu/target_info.h +2 more+23 -41 reply
4/19qemu: Convert target_words_bigendian() to TargetInfo APIcpu-target.c hw/core/cpu-system.c hw/display/vga.c +7 more+26 -211 reply
5/19qemu: Introduce target_long_bits()include/qemu/target_info-impl.h include/qemu/target_info.h target_info-stub.c +1 more+11 -01 reply
6/19target/tricore: Replace TARGET_LONG_BITS -> target_long_bits()target/tricore/translate.c+4 -24 replies
7/19target/hppa: Replace TARGET_LONG_BITS -> target_long_bits()target/hppa/mem_helper.c target/hppa/translate.c+4 -23 replies
8/19target/riscv: Replace TARGET_LONG_BITS -> target_long_bits()hw/riscv/riscv-iommu.c hw/riscv/riscv_hart.c+4 -22 replies
9/19qemu: Introduce target_cpu_type()include/qemu/target_info-impl.h include/qemu/target_info.h target_info-stub.c +1 more+12 -01 reply
10/19cpus: Replace CPU_RESOLVING_TYPE -> target_cpu_type()cpu-target.c+4 -31 reply
11/19accel/tcg: Replace CPU_RESOLVING_TYPE -> target_cpu_type()accel/tcg/tcg-all.c+2 -23 replies
12/19cpus: Move target-agnostic methods out of cpu-target.ccpu-target.c hw/core/cpu-common.c+75 -771 reply
13/19accel: Replace CPU_RESOLVING_TYPE -> target_cpu_type()accel/accel-target.c+4 -21 reply
14/19accel: Implement accel_init_ops_interfaces() for both system/user modeaccel/accel-internal.h accel/accel-system.c accel/accel-target.c +1 more+14 -141 reply
15/19accel: Include missing 'qemu/accel.h' header in accel-internal.haccel/accel-internal.h+2 -01 reply
16/19accel: Make AccelCPUClass structure target-agnosticaccel/accel-target.c include/accel/accel-cpu-target.h include/accel/accel-cpu.h+24 -121 reply
17/19accel: Move target-agnostic code from accel-target.c -> accel-common.caccel/accel-common.c accel/accel-target.c accel/meson.build+143 -1292 replies
18/19qemu: Prepare per-binary QOM filter via TYPE_BINARY_PREFIXinclude/hw/boards.h include/qemu/target_info-qom.h meson.build +1 more+31 -01 reply
19/19system/vl: Filter machine list for binary using machine_binary_filter()system/vl.c+24 -04 replies

Reviews trailers per patch

12 of 19 patches have a Reviewed-by or Acked-by.

PatchPierrick Bouvier
1/19
2/19R-b
3/19
4/19R-b
5/19R-b
6/19
7/19
8/19
9/19R-b
10/19R-b
11/19R-b
12/19R-b
13/19R-b
14/19R-b
15/19R-b
16/19R-b
17/19R-b
18/19
19/19

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

Read the v1 thread

Cover letter [RFC PATCH-for-10.1 00/19] qemu: Introduce TargetInfo API (for single binary)

Hi,

At this point this series is mostly a draft for Pierrick. It implement his idea of a per-binary structure containing all target-specific information, exposing them via a target-agnostic API. Commits are barely commented, since I'd rather get feedback before pursuing further.

Available here, based on tcg-next:
https://gitlab.com/philmd/qemu/-/tags/single-binary-target-info-api-rfc-v1

Another series will follow with the ARM implementation.

Regards,

Phil.

Philippe Mathieu-Daudé (19):
qemu: Introduce TargetInfo API in 'target_info.h'
qemu: Convert target_name() to TargetInfo API
qemu: Factor target_system_arch() out
qemu: Convert target_words_bigendian() to TargetInfo API
qemu: Introduce target_long_bits()
target/tricore: Replace TARGET_LONG_BITS -> target_long_bits() target/hppa: Replace TARGET_LONG_BITS -> target_long_bits() target/riscv: Replace TARGET_LONG_BITS -> target_long_bits()
qemu: Introduce target_cpu_type()
cpus: Replace CPU_RESOLVING_TYPE -> target_cpu_type() accel/tcg: Replace CPU_RESOLVING_TYPE -> target_cpu_type()
cpus: Move target-agnostic methods out of cpu-target.c
accel: Replace CPU_RESOLVING_TYPE -> target_cpu_type()
accel: Implement accel_init_ops_interfaces() for both system/user mode
accel: Include missing 'qemu/accel.h' header in accel-internal.h
accel: Make AccelCPUClass structure target-agnostic
accel: Move target-agnostic code from accel-target.c -> accel-common.c
qemu: Prepare per-binary QOM filter via TYPE_BINARY_PREFIX system/vl: Filter machine list for binary using
machine_binary_filter()

 meson.build                                |  10 ++
 accel/{accel-system.h => accel-internal.h} |  10 +-
 include/accel/accel-cpu-target.h           |  12 +-
 include/accel/accel-cpu.h                  |  23 ++++
 include/exec/poison.h                      |   1 +
 include/exec/tswap.h                       |  13 +-
 include/hw/boards.h                        |   1 +
 include/hw/core/cpu.h                      |   2 -
 include/qemu/target_info-impl.h            |  38 ++++++
 include/qemu/target_info-qom.h             |  14 ++
 include/qemu/target_info.h                 |  39 ++++++
 accel/accel-common.c                       | 142 +++++++++++++++++++++
 accel/accel-system.c                       |   4 +-
 accel/accel-target.c                       | 134 -------------------
 accel/accel-user.c                         |   6 +
 accel/tcg/tcg-all.c                        |   4 +-
 cpu-target.c                               |  88 +------------
 hw/core/cpu-common.c                       |  74 +++++++++++
 hw/core/cpu-system.c                       |   2 +-
 hw/core/machine-qmp-cmds.c                 |   7 +-
 hw/display/vga.c                           |   2 +-
 hw/riscv/riscv-iommu.c                     |   3 +-
 hw/riscv/riscv_hart.c                      |   3 +-
 hw/virtio/virtio.c                         |   2 +-
 plugins/loader.c                           |   2 +-
 system/qtest.c                             |   1 +
 system/vl.c                                |  26 +++-
 target/hppa/mem_helper.c                   |   3 +-
 target/hppa/translate.c                    |   3 +-
 target/tricore/translate.c                 |   6 +-
 target_info-qom.c                          |  15 +++
 target_info-stub.c                         |  29 +++++
 target_info.c                              |  48 +++++++
 accel/meson.build                          |   1 +
 34 files changed, 499 insertions(+), 269 deletions(-)
 rename accel/{accel-system.h => accel-internal.h} (56%)
 create mode 100644 include/accel/accel-cpu.h
 create mode 100644 include/qemu/target_info-impl.h
 create mode 100644 include/qemu/target_info-qom.h
 create mode 100644 include/qemu/target_info.h
 create mode 100644 accel/accel-common.c
 create mode 100644 target_info-qom.c
 create mode 100644 target_info-stub.c
 create mode 100644 target_info.c
Signature · 1 line
2.47.1