[PATCH-for-9.1 00/27] accel/tcg: Introduce TCGCPUOps::get_cpu_state() handler

Philippe Mathieu-Daudé posted 27 patches 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240319154258.71206-1-philmd@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>, Brian Cain <bcain@quicinc.com>, Eduardo Habkost <eduardo@habkost.net>, 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 <aleksandar.rikalo@syrmia.com>, Chris Wulff <crwulff@gmail.com>, Marek Vasut <marex@denx.de>, 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 <bin.meng@windriver.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>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Max Filippov <jcmvbkbc@gmail.com>
accel/tcg/internal-target.h             |   2 +
include/hw/core/tcg-cpu-ops.h           |   3 +
target/alpha/cpu.h                      |  11 ---
target/arm/cpu.h                        |   3 -
target/arm/internals.h                  |   6 +-
target/avr/cpu.h                        |  18 ----
target/cris/cpu.h                       |  10 ---
target/hexagon/cpu.h                    |  12 ---
target/hppa/cpu.h                       |  42 ---------
target/i386/cpu.h                       |  14 ---
target/loongarch/cpu.h                  |  12 ---
target/m68k/cpu.h                       |  16 ----
target/microblaze/cpu.h                 |   8 --
target/mips/cpu.h                       |   9 --
target/mips/tcg/tcg-internal.h          |   2 +
target/nios2/cpu.h                      |  12 ---
target/openrisc/cpu.h                   |  10 ---
target/ppc/cpu.h                        |  14 +--
target/riscv/cpu.h                      |   3 -
target/rx/cpu.h                         |   9 --
target/s390x/cpu.h                      |  28 ------
target/s390x/s390x-internal.h           |   4 +
target/sh4/cpu.h                        |  15 ----
target/sparc/cpu.h                      |  35 +-------
target/tricore/cpu.h                    |  12 ---
target/xtensa/cpu.h                     |  68 ---------------
accel/tcg/cpu-exec.c                    |   6 +-
accel/tcg/translate-all.c               |   8 ++
target/alpha/cpu.c                      |  12 +++
target/arm/cpu.c                        | 110 ++++++++++++++++++++++++
target/arm/helper.c                     | 109 -----------------------
target/arm/tcg-stubs.c                  |   4 -
target/arm/tcg/cpu-v7m.c                |   1 +
target/avr/cpu.c                        |  19 ++++
target/cris/cpu.c                       |  11 +++
target/hexagon/cpu.c                    |  13 +++
target/hppa/cpu.c                       |  43 +++++++++
target/i386/cpu.c                       |   2 +-
target/i386/tcg/tcg-cpu.c               |  15 ++++
target/loongarch/cpu.c                  |  15 ++++
target/m68k/cpu.c                       |  17 ++++
target/microblaze/cpu.c                 |   9 ++
target/mips/cpu.c                       |   1 +
target/mips/tcg/translate.c             |   9 ++
target/nios2/cpu.c                      |  13 +++
target/openrisc/cpu.c                   |  11 +++
target/ppc/cpu_init.c                   |  27 +++---
target/ppc/helper_regs.c                |  13 +--
target/riscv/cpu.c                      |   2 +-
target/riscv/cpu_helper.c               |  87 -------------------
target/riscv/tcg/tcg-cpu.c              |  88 +++++++++++++++++++
target/rx/cpu.c                         |  10 +++
target/s390x/cpu.c                      |   1 +
target/s390x/tcg/mem_helper.c           |   2 +-
target/s390x/tcg/translate.c            |  23 +++++
target/sh4/cpu.c                        |  16 ++++
target/sparc/cpu.c                      |   1 +
target/sparc/translate.c                |  33 +++++++
target/tricore/cpu.c                    |  13 +++
target/xtensa/cpu.c                     |  69 +++++++++++++++
target/riscv/insn_trans/trans_rvv.c.inc |   2 +-
61 files changed, 611 insertions(+), 582 deletions(-)
[PATCH-for-9.1 00/27] accel/tcg: Introduce TCGCPUOps::get_cpu_state() handler
Posted by Philippe Mathieu-Daudé 1 month, 1 week ago
Hi,

This series introduce a generic get_cpu_state() handler in
TCGCPUOps and convert each target to it.

This is required to get a single cpu_get_tb_cpu_state()
for heterogeneous emulation (since this method is called
by accel/tcg/).

Regards,

Phil.

Philippe Mathieu-Daudé (27):
  accel/tcg: Ensure frontends define restore_state_to_opc handler
  accel/tcg: Introduce TCGCPUOps::get_cpu_state() handler
  target/alpha: Convert to TCGCPUOps::get_cpu_state()
  target/arm: Restrict TCG-specific declarations
  target/arm: Convert to TCGCPUOps::get_cpu_state()
  target/avr: Convert to TCGCPUOps::get_cpu_state()
  target/cris: Convert to TCGCPUOps::get_cpu_state()
  target/hexagon: Convert to TCGCPUOps::get_cpu_state()
  target/hppa: Convert to TCGCPUOps::get_cpu_state()
  target/i386: Convert to TCGCPUOps::get_cpu_state()
  target/loongarch: Convert to TCGCPUOps::get_cpu_state()
  target/m68k: Convert to TCGCPUOps::get_cpu_state()
  target/microblaze: Convert to TCGCPUOps::get_cpu_state()
  target/mips: Convert to TCGCPUOps::get_cpu_state()
  target/nios2: Convert to TCGCPUOps::get_cpu_state()
  target/openrisc: Convert to TCGCPUOps::get_cpu_state()
  target/ppc: Indent ppc_tcg_ops[] with 4 spaces
  target/ppc: Convert to TCGCPUOps::get_cpu_state()
  target/riscv: Convert to TCGCPUOps::get_cpu_state()
  target/rx: Convert to TCGCPUOps::get_cpu_state()
  target/s390x: Restrict TCG-specific declarations
  target/s390x: Convert to TCGCPUOps::get_cpu_state()
  target/sh4: Convert to TCGCPUOps::get_cpu_state()
  target/sparc: Convert to TCGCPUOps::get_cpu_state()
  target/tricore: Convert to TCGCPUOps::get_cpu_state()
  target/xtensa: Convert to TCGCPUOps::get_cpu_state()
  accel/tcg: Remove check on TARGET_HAS_CPU_GET_TB_CPU_STATE

 accel/tcg/internal-target.h             |   2 +
 include/hw/core/tcg-cpu-ops.h           |   3 +
 target/alpha/cpu.h                      |  11 ---
 target/arm/cpu.h                        |   3 -
 target/arm/internals.h                  |   6 +-
 target/avr/cpu.h                        |  18 ----
 target/cris/cpu.h                       |  10 ---
 target/hexagon/cpu.h                    |  12 ---
 target/hppa/cpu.h                       |  42 ---------
 target/i386/cpu.h                       |  14 ---
 target/loongarch/cpu.h                  |  12 ---
 target/m68k/cpu.h                       |  16 ----
 target/microblaze/cpu.h                 |   8 --
 target/mips/cpu.h                       |   9 --
 target/mips/tcg/tcg-internal.h          |   2 +
 target/nios2/cpu.h                      |  12 ---
 target/openrisc/cpu.h                   |  10 ---
 target/ppc/cpu.h                        |  14 +--
 target/riscv/cpu.h                      |   3 -
 target/rx/cpu.h                         |   9 --
 target/s390x/cpu.h                      |  28 ------
 target/s390x/s390x-internal.h           |   4 +
 target/sh4/cpu.h                        |  15 ----
 target/sparc/cpu.h                      |  35 +-------
 target/tricore/cpu.h                    |  12 ---
 target/xtensa/cpu.h                     |  68 ---------------
 accel/tcg/cpu-exec.c                    |   6 +-
 accel/tcg/translate-all.c               |   8 ++
 target/alpha/cpu.c                      |  12 +++
 target/arm/cpu.c                        | 110 ++++++++++++++++++++++++
 target/arm/helper.c                     | 109 -----------------------
 target/arm/tcg-stubs.c                  |   4 -
 target/arm/tcg/cpu-v7m.c                |   1 +
 target/avr/cpu.c                        |  19 ++++
 target/cris/cpu.c                       |  11 +++
 target/hexagon/cpu.c                    |  13 +++
 target/hppa/cpu.c                       |  43 +++++++++
 target/i386/cpu.c                       |   2 +-
 target/i386/tcg/tcg-cpu.c               |  15 ++++
 target/loongarch/cpu.c                  |  15 ++++
 target/m68k/cpu.c                       |  17 ++++
 target/microblaze/cpu.c                 |   9 ++
 target/mips/cpu.c                       |   1 +
 target/mips/tcg/translate.c             |   9 ++
 target/nios2/cpu.c                      |  13 +++
 target/openrisc/cpu.c                   |  11 +++
 target/ppc/cpu_init.c                   |  27 +++---
 target/ppc/helper_regs.c                |  13 +--
 target/riscv/cpu.c                      |   2 +-
 target/riscv/cpu_helper.c               |  87 -------------------
 target/riscv/tcg/tcg-cpu.c              |  88 +++++++++++++++++++
 target/rx/cpu.c                         |  10 +++
 target/s390x/cpu.c                      |   1 +
 target/s390x/tcg/mem_helper.c           |   2 +-
 target/s390x/tcg/translate.c            |  23 +++++
 target/sh4/cpu.c                        |  16 ++++
 target/sparc/cpu.c                      |   1 +
 target/sparc/translate.c                |  33 +++++++
 target/tricore/cpu.c                    |  13 +++
 target/xtensa/cpu.c                     |  69 +++++++++++++++
 target/riscv/insn_trans/trans_rvv.c.inc |   2 +-
 61 files changed, 611 insertions(+), 582 deletions(-)

-- 
2.41.0


Re: [PATCH-for-9.1 00/27] accel/tcg: Introduce TCGCPUOps::get_cpu_state() handler
Posted by Philippe Mathieu-Daudé 1 month, 1 week ago
(Forgot to Cc Claudio to keep him updated)

On 19/3/24 16:42, Philippe Mathieu-Daudé wrote:
> Hi,
> 
> This series introduce a generic get_cpu_state() handler in
> TCGCPUOps and convert each target to it.
> 
> This is required to get a single cpu_get_tb_cpu_state()
> for heterogeneous emulation (since this method is called
> by accel/tcg/).
> 
> Regards,
> 
> Phil.
> 
> Philippe Mathieu-Daudé (27):
>    accel/tcg: Ensure frontends define restore_state_to_opc handler
>    accel/tcg: Introduce TCGCPUOps::get_cpu_state() handler
>    target/alpha: Convert to TCGCPUOps::get_cpu_state()
>    target/arm: Restrict TCG-specific declarations
>    target/arm: Convert to TCGCPUOps::get_cpu_state()
>    target/avr: Convert to TCGCPUOps::get_cpu_state()
>    target/cris: Convert to TCGCPUOps::get_cpu_state()
>    target/hexagon: Convert to TCGCPUOps::get_cpu_state()
>    target/hppa: Convert to TCGCPUOps::get_cpu_state()
>    target/i386: Convert to TCGCPUOps::get_cpu_state()
>    target/loongarch: Convert to TCGCPUOps::get_cpu_state()
>    target/m68k: Convert to TCGCPUOps::get_cpu_state()
>    target/microblaze: Convert to TCGCPUOps::get_cpu_state()
>    target/mips: Convert to TCGCPUOps::get_cpu_state()
>    target/nios2: Convert to TCGCPUOps::get_cpu_state()
>    target/openrisc: Convert to TCGCPUOps::get_cpu_state()
>    target/ppc: Indent ppc_tcg_ops[] with 4 spaces
>    target/ppc: Convert to TCGCPUOps::get_cpu_state()
>    target/riscv: Convert to TCGCPUOps::get_cpu_state()
>    target/rx: Convert to TCGCPUOps::get_cpu_state()
>    target/s390x: Restrict TCG-specific declarations
>    target/s390x: Convert to TCGCPUOps::get_cpu_state()
>    target/sh4: Convert to TCGCPUOps::get_cpu_state()
>    target/sparc: Convert to TCGCPUOps::get_cpu_state()
>    target/tricore: Convert to TCGCPUOps::get_cpu_state()
>    target/xtensa: Convert to TCGCPUOps::get_cpu_state()
>    accel/tcg: Remove check on TARGET_HAS_CPU_GET_TB_CPU_STATE


Re: [PATCH-for-9.1 00/27] accel/tcg: Introduce TCGCPUOps::get_cpu_state() handler
Posted by Claudio Fontana 1 month, 1 week ago
Thanks Philippe, I fear I am unable to really be uptodate,
but it's great to see all the cleanup you and others have done!

Ciao,

Claudio

On 3/19/24 16:48, Philippe Mathieu-Daudé wrote:
> (Forgot to Cc Claudio to keep him updated)
> 
> On 19/3/24 16:42, Philippe Mathieu-Daudé wrote:
>> Hi,
>>
>> This series introduce a generic get_cpu_state() handler in
>> TCGCPUOps and convert each target to it.
>>
>> This is required to get a single cpu_get_tb_cpu_state()
>> for heterogeneous emulation (since this method is called
>> by accel/tcg/).
>>
>> Regards,
>>
>> Phil.
>>
>> Philippe Mathieu-Daudé (27):
>>    accel/tcg: Ensure frontends define restore_state_to_opc handler
>>    accel/tcg: Introduce TCGCPUOps::get_cpu_state() handler
>>    target/alpha: Convert to TCGCPUOps::get_cpu_state()
>>    target/arm: Restrict TCG-specific declarations
>>    target/arm: Convert to TCGCPUOps::get_cpu_state()
>>    target/avr: Convert to TCGCPUOps::get_cpu_state()
>>    target/cris: Convert to TCGCPUOps::get_cpu_state()
>>    target/hexagon: Convert to TCGCPUOps::get_cpu_state()
>>    target/hppa: Convert to TCGCPUOps::get_cpu_state()
>>    target/i386: Convert to TCGCPUOps::get_cpu_state()
>>    target/loongarch: Convert to TCGCPUOps::get_cpu_state()
>>    target/m68k: Convert to TCGCPUOps::get_cpu_state()
>>    target/microblaze: Convert to TCGCPUOps::get_cpu_state()
>>    target/mips: Convert to TCGCPUOps::get_cpu_state()
>>    target/nios2: Convert to TCGCPUOps::get_cpu_state()
>>    target/openrisc: Convert to TCGCPUOps::get_cpu_state()
>>    target/ppc: Indent ppc_tcg_ops[] with 4 spaces
>>    target/ppc: Convert to TCGCPUOps::get_cpu_state()
>>    target/riscv: Convert to TCGCPUOps::get_cpu_state()
>>    target/rx: Convert to TCGCPUOps::get_cpu_state()
>>    target/s390x: Restrict TCG-specific declarations
>>    target/s390x: Convert to TCGCPUOps::get_cpu_state()
>>    target/sh4: Convert to TCGCPUOps::get_cpu_state()
>>    target/sparc: Convert to TCGCPUOps::get_cpu_state()
>>    target/tricore: Convert to TCGCPUOps::get_cpu_state()
>>    target/xtensa: Convert to TCGCPUOps::get_cpu_state()
>>    accel/tcg: Remove check on TARGET_HAS_CPU_GET_TB_CPU_STATE
> 


Re: [PATCH-for-9.1 00/27] accel/tcg: Introduce TCGCPUOps::get_cpu_state() handler
Posted by Richard Henderson 1 month, 1 week ago
On 3/19/24 05:42, Philippe Mathieu-Daudé wrote:
> Philippe Mathieu-Daudé (27):
>    accel/tcg: Ensure frontends define restore_state_to_opc handler
>    accel/tcg: Introduce TCGCPUOps::get_cpu_state() handler
>    target/alpha: Convert to TCGCPUOps::get_cpu_state()
>    target/arm: Restrict TCG-specific declarations
>    target/arm: Convert to TCGCPUOps::get_cpu_state()
>    target/avr: Convert to TCGCPUOps::get_cpu_state()
>    target/cris: Convert to TCGCPUOps::get_cpu_state()
>    target/hexagon: Convert to TCGCPUOps::get_cpu_state()
>    target/hppa: Convert to TCGCPUOps::get_cpu_state()
>    target/i386: Convert to TCGCPUOps::get_cpu_state()
>    target/loongarch: Convert to TCGCPUOps::get_cpu_state()
>    target/m68k: Convert to TCGCPUOps::get_cpu_state()
>    target/microblaze: Convert to TCGCPUOps::get_cpu_state()
>    target/mips: Convert to TCGCPUOps::get_cpu_state()
>    target/nios2: Convert to TCGCPUOps::get_cpu_state()
>    target/openrisc: Convert to TCGCPUOps::get_cpu_state()
>    target/ppc: Indent ppc_tcg_ops[] with 4 spaces
>    target/ppc: Convert to TCGCPUOps::get_cpu_state()
>    target/riscv: Convert to TCGCPUOps::get_cpu_state()
>    target/rx: Convert to TCGCPUOps::get_cpu_state()
>    target/s390x: Restrict TCG-specific declarations
>    target/s390x: Convert to TCGCPUOps::get_cpu_state()
>    target/sh4: Convert to TCGCPUOps::get_cpu_state()
>    target/sparc: Convert to TCGCPUOps::get_cpu_state()
>    target/tricore: Convert to TCGCPUOps::get_cpu_state()
>    target/xtensa: Convert to TCGCPUOps::get_cpu_state()
>    accel/tcg: Remove check on TARGET_HAS_CPU_GET_TB_CPU_STATE

Modulo 3 notes,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~