[PATCH v4 0/3] Register accel-$cpu_type for all targets

Yonggang Luo posted 3 patches 2 weeks, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20261105183310.1614-1-luoyonggang@gmail.com
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>, Peter Maydell <peter.maydell@linaro.org>, Zhao Liu <zhao1.liu@intel.com>, Chinmay Rath <rathc@linux.ibm.com>, Nicholas Piggin <npiggin@gmail.com>, Glenn Miles <milesg@linux.ibm.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Chao Liu <chao.liu@processmission.com>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
There is a newer version of this series
accel/accel-common.c           |  6 ++----
include/accel/accel-cpu.h      |  2 ++
target/arm/cpu.c               |  2 ++
target/i386/cpu.c              |  2 ++
target/ppc/cpu_init.c          |  2 ++
target/riscv/cpu.c             |  8 ++++++++
target/riscv/kvm/kvm-cpu.c     |  2 --
target/riscv/tcg/tcg-cpu.c     |  1 -
tests/unit/test-multi-target.c | 25 +++++++++++++++++++++++++
9 files changed, 43 insertions(+), 7 deletions(-)
[PATCH v4 0/3] Register accel-$cpu_type for all targets
Posted by Yonggang Luo 2 weeks, 3 days ago
A multi-target system binary links more than one target.
accel_cpu_register_type() creates the abstract parent accel-$cpu_type for each
target that has an AccelCPU subclass. ARM, i386, RISC-V, and PowerPC call it.
Other targets have no such subclass, and machine init skips a missing class.

test-multi-target checks the parent only for the CPU types that register it.

This is an alternative to gating accelerator CPU types with is_available. The
RISC-V TCG and KVM gates are reverted here as redundant.

v3: https://lore.kernel.org/qemu-devel/20261031170925.789-1-luoyonggang@gmail.com/

Changes v3 -> v4:

- Drop accel-cpu-target.c and the once-per-TARGET_BASE_ARCH build. Register the
  parent with accel_cpu_register_type() only where an AccelCPU subclass exists
- Call it from ARM, i386, RISC-V, and PowerPC. v3 registered a parent for every
  linked target
- Check those parents from test_qom_types_are_unique(). v3 expected one for
  every target in the test

Yonggang Luo (3):
  accel: register CPU parent only for AccelCPU subclasses
  Revert "target/riscv/kvm: restrict kvm-accel-riscv-cpu to riscv
    targets"
  Revert "target/riscv/tcg: restrict tcg-accel-riscv-cpu to riscv
    targets"

 accel/accel-common.c           |  6 ++----
 include/accel/accel-cpu.h      |  2 ++
 target/arm/cpu.c               |  2 ++
 target/i386/cpu.c              |  2 ++
 target/ppc/cpu_init.c          |  2 ++
 target/riscv/cpu.c             |  8 ++++++++
 target/riscv/kvm/kvm-cpu.c     |  2 --
 target/riscv/tcg/tcg-cpu.c     |  1 -
 tests/unit/test-multi-target.c | 25 +++++++++++++++++++++++++
 9 files changed, 43 insertions(+), 7 deletions(-)

-- 
2.55.0.windows.3