[PATCH 0/3] cpu_exec_halt: make method mandatory

Peter Maydell posted 3 patches 1 year, 10 months ago
include/hw/core/tcg-cpu-ops.h | 9 ++++++---
target/arm/internals.h        | 3 +++
target/riscv/internals.h      | 3 +++
accel/tcg/cpu-exec.c          | 7 +------
target/alpha/cpu.c            | 1 +
target/arm/cpu.c              | 2 +-
target/arm/tcg/cpu-v7m.c      | 1 +
target/avr/cpu.c              | 1 +
target/cris/cpu.c             | 2 ++
target/hppa/cpu.c             | 1 +
target/loongarch/cpu.c        | 1 +
target/m68k/cpu.c             | 1 +
target/microblaze/cpu.c       | 1 +
target/mips/cpu.c             | 1 +
target/openrisc/cpu.c         | 1 +
target/ppc/cpu_init.c         | 2 ++
target/riscv/cpu.c            | 2 +-
target/riscv/tcg/tcg-cpu.c    | 2 ++
target/rx/cpu.c               | 1 +
target/s390x/cpu.c            | 1 +
target/sh4/cpu.c              | 1 +
target/sparc/cpu.c            | 1 +
target/xtensa/cpu.c           | 1 +
23 files changed, 35 insertions(+), 11 deletions(-)
[PATCH 0/3] cpu_exec_halt: make method mandatory
Posted by Peter Maydell 1 year, 10 months ago
This patchset makes the TCGCPUOps::cpu_exec_halt method
mandatory, which is a cleanup that RTH asked for when we
were discussing my FEAT_WFxT series.

I'm not 100% convinced about this, because if we ever find we
need to change the cpu_exec_halt method so it's no longer the
exact same function signature as the has_work method then
we'll have to undo this change. But I don't feel very strongly
about it, and it does mean we can skip a runtime check for
whether the method exists.

We probably want patch 1 anyway; I didn't notice at the
time that M-profile has its own TCGCPUOps, and it's less
confusing if A and M both use the same arm_cpu_exec_halt().
(This isn't a bug in the FEAT_WFxT commit, though -- the
behaviour is the same.)

thanks
-- PMM

Peter Maydell (3):
  target/arm: Set arm_v7m_tcg_ops cpu_exec_halt to arm_cpu_exec_halt()
  target: Set TCGCPUOps::cpu_exec_halt to target's has_work
    implementation
  accel/tcg: Make TCGCPUOps::cpu_exec_halt mandatory

 include/hw/core/tcg-cpu-ops.h | 9 ++++++---
 target/arm/internals.h        | 3 +++
 target/riscv/internals.h      | 3 +++
 accel/tcg/cpu-exec.c          | 7 +------
 target/alpha/cpu.c            | 1 +
 target/arm/cpu.c              | 2 +-
 target/arm/tcg/cpu-v7m.c      | 1 +
 target/avr/cpu.c              | 1 +
 target/cris/cpu.c             | 2 ++
 target/hppa/cpu.c             | 1 +
 target/loongarch/cpu.c        | 1 +
 target/m68k/cpu.c             | 1 +
 target/microblaze/cpu.c       | 1 +
 target/mips/cpu.c             | 1 +
 target/openrisc/cpu.c         | 1 +
 target/ppc/cpu_init.c         | 2 ++
 target/riscv/cpu.c            | 2 +-
 target/riscv/tcg/tcg-cpu.c    | 2 ++
 target/rx/cpu.c               | 1 +
 target/s390x/cpu.c            | 1 +
 target/sh4/cpu.c              | 1 +
 target/sparc/cpu.c            | 1 +
 target/xtensa/cpu.c           | 1 +
 23 files changed, 35 insertions(+), 11 deletions(-)

-- 
2.34.1
Re: [PATCH 0/3] cpu_exec_halt: make method mandatory
Posted by Richard Henderson 1 year, 10 months ago
On 6/3/24 11:09, Peter Maydell wrote:
> Peter Maydell (3):
>    target/arm: Set arm_v7m_tcg_ops cpu_exec_halt to arm_cpu_exec_halt()
>    target: Set TCGCPUOps::cpu_exec_halt to target's has_work
>      implementation
>    accel/tcg: Make TCGCPUOps::cpu_exec_halt mandatory

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

r~