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
--
2.47.1