[PATCH 0/3] cpu_exec_halt: make method mandatory

Peter Maydell posted 3 patches 5 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240603160933.1141717-1-peter.maydell@linaro.org
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Song Gao <gaosong@loongson.cn>, Laurent Vivier <laurent@vivier.eu>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <arikalo@gmail.com>, Stafford Horne <shorne@gmail.com>, Nicholas Piggin <npiggin@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Bin Meng <bmeng.cn@gmail.com>, Weiwei Li <liwei1518@gmail.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Thomas Huth <thuth@redhat.com>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>, Max Filippov <jcmvbkbc@gmail.com>
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 5 months, 3 weeks 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 5 months, 3 weeks 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~