mbox series

[RFC,PATCH-for-10.1,0/4] tcg: Move TCG_GUEST_DEFAULT_MO -> TCGCPUOps::guest_default_memory_order

Message ID 20250321125737.72839-1-philmd@linaro.org
Headers show
Series tcg: Move TCG_GUEST_DEFAULT_MO -> TCGCPUOps::guest_default_memory_order | expand

Message

Philippe Mathieu-Daudé March 21, 2025, 12:57 p.m. UTC
Hi,

In this series we replace the TCG_GUEST_DEFAULT_MO definition
from "cpu-param.h" by a 'guest_default_memory_order' field in
TCGCPUOps.

Since tcg_req_mo() now accesses tcg_ctx, this impact the
cpu_req_mo() calls in accel/tcg/{cputlb,user-exec}.c.

The long term goal is to be able to use targets with distinct
guest memory order restrictions.

Philippe Mathieu-Daudé (4):
  tcg: Always define TCG_GUEST_DEFAULT_MO
  tcg: Simplify tcg_req_mo() macro
  tcg: Have tcg_req_mo() use runtime TCGContext::guest_mo
  tcg: Define guest_default_memory_order in TCGCPUOps

 accel/tcg/internal-target.h   | 13 ++-----------
 include/accel/tcg/cpu-ops.h   |  8 ++++++++
 target/alpha/cpu-param.h      |  3 ---
 target/arm/cpu-param.h        |  3 ---
 target/avr/cpu-param.h        |  2 --
 target/hppa/cpu-param.h       |  8 --------
 target/i386/cpu-param.h       |  3 ---
 target/loongarch/cpu-param.h  |  2 --
 target/microblaze/cpu-param.h |  3 ---
 target/mips/cpu-param.h       |  2 --
 target/openrisc/cpu-param.h   |  2 --
 target/ppc/cpu-param.h        |  2 --
 target/riscv/cpu-param.h      |  2 --
 target/s390x/cpu-param.h      |  6 ------
 target/sparc/cpu-param.h      | 23 -----------------------
 target/xtensa/cpu-param.h     |  3 ---
 accel/tcg/tcg-all.c           |  3 ---
 accel/tcg/translate-all.c     |  6 +-----
 target/alpha/cpu.c            |  3 +++
 target/arm/cpu.c              |  3 +++
 target/arm/tcg/cpu-v7m.c      |  3 +++
 target/avr/cpu.c              |  1 +
 target/hexagon/cpu.c          |  2 ++
 target/hppa/cpu.c             |  8 ++++++++
 target/i386/tcg/tcg-cpu.c     |  5 +++++
 target/loongarch/cpu.c        |  2 ++
 target/m68k/cpu.c             |  3 +++
 target/microblaze/cpu.c       |  3 +++
 target/mips/cpu.c             |  2 ++
 target/openrisc/cpu.c         |  2 ++
 target/ppc/cpu_init.c         |  2 ++
 target/riscv/tcg/tcg-cpu.c    |  2 ++
 target/rx/cpu.c               |  3 +++
 target/s390x/cpu.c            |  6 ++++++
 target/sh4/cpu.c              |  3 +++
 target/sparc/cpu.c            | 23 +++++++++++++++++++++++
 target/tricore/cpu.c          |  2 ++
 target/xtensa/cpu.c           |  3 +++
 38 files changed, 92 insertions(+), 83 deletions(-)

Comments

Anton Johansson March 21, 2025, 2:40 p.m. UTC | #1
On 21/03/25, Philippe Mathieu-Daudé wrote:
> Hi,
> 
> In this series we replace the TCG_GUEST_DEFAULT_MO definition
> from "cpu-param.h" by a 'guest_default_memory_order' field in
> TCGCPUOps.
> 
> Since tcg_req_mo() now accesses tcg_ctx, this impact the
> cpu_req_mo() calls in accel/tcg/{cputlb,user-exec}.c.
> 
> The long term goal is to be able to use targets with distinct
> guest memory order restrictions.
> 
> Philippe Mathieu-Daudé (4):
>   tcg: Always define TCG_GUEST_DEFAULT_MO
>   tcg: Simplify tcg_req_mo() macro
>   tcg: Have tcg_req_mo() use runtime TCGContext::guest_mo
>   tcg: Define guest_default_memory_order in TCGCPUOps
> 
>  accel/tcg/internal-target.h   | 13 ++-----------
>  include/accel/tcg/cpu-ops.h   |  8 ++++++++
>  target/alpha/cpu-param.h      |  3 ---
>  target/arm/cpu-param.h        |  3 ---
>  target/avr/cpu-param.h        |  2 --
>  target/hppa/cpu-param.h       |  8 --------
>  target/i386/cpu-param.h       |  3 ---
>  target/loongarch/cpu-param.h  |  2 --
>  target/microblaze/cpu-param.h |  3 ---
>  target/mips/cpu-param.h       |  2 --
>  target/openrisc/cpu-param.h   |  2 --
>  target/ppc/cpu-param.h        |  2 --
>  target/riscv/cpu-param.h      |  2 --
>  target/s390x/cpu-param.h      |  6 ------
>  target/sparc/cpu-param.h      | 23 -----------------------
>  target/xtensa/cpu-param.h     |  3 ---
>  accel/tcg/tcg-all.c           |  3 ---
>  accel/tcg/translate-all.c     |  6 +-----
>  target/alpha/cpu.c            |  3 +++
>  target/arm/cpu.c              |  3 +++
>  target/arm/tcg/cpu-v7m.c      |  3 +++
>  target/avr/cpu.c              |  1 +
>  target/hexagon/cpu.c          |  2 ++
>  target/hppa/cpu.c             |  8 ++++++++
>  target/i386/tcg/tcg-cpu.c     |  5 +++++
>  target/loongarch/cpu.c        |  2 ++
>  target/m68k/cpu.c             |  3 +++
>  target/microblaze/cpu.c       |  3 +++
>  target/mips/cpu.c             |  2 ++
>  target/openrisc/cpu.c         |  2 ++
>  target/ppc/cpu_init.c         |  2 ++
>  target/riscv/tcg/tcg-cpu.c    |  2 ++
>  target/rx/cpu.c               |  3 +++
>  target/s390x/cpu.c            |  6 ++++++
>  target/sh4/cpu.c              |  3 +++
>  target/sparc/cpu.c            | 23 +++++++++++++++++++++++
>  target/tricore/cpu.c          |  2 ++
>  target/xtensa/cpu.c           |  3 +++
>  38 files changed, 92 insertions(+), 83 deletions(-)
> 
> -- 
> 2.47.1
> 

Reviewed-by: Anton Johansson <anjo@rev.ng>