qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/27] Replace TARGET_TB_PCREL with CF_PCREL
@ 2023-02-27 13:51 Anton Johansson via
  2023-02-27 13:51 ` [PATCH v3 01/27] include/exec: Introduce `CF_PCREL` Anton Johansson via
                   ` (27 more replies)
  0 siblings, 28 replies; 33+ messages in thread
From: Anton Johansson via @ 2023-02-27 13:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: ale, richard.henderson, pbonzini, eduardo, peter.maydell, mrolnik,
	tsimpson, gaosong, yangxiaojuan, edgar.iglesias, philmd, shorne,
	palmer, alistair.francis, bin.meng, ysato, mark.cave-ayland,
	atar4qemu, kbastian

This patchset entirely replaces the macro TARGET_TB_PCREL with
a field in TranslationBlock.cflags called CF_PCREL, and is a
first step towards removing target-specific assumptions from
non-target/ directories.

The grand goal is to allow for heterogeneous QEMU binaries
consisting of multiple frontends.

RFC: https://lists.nongnu.org/archive/html/qemu-devel/2022-12/msg04518.html

Changes in v2:
  * Setting of CF_PCREL (previously patch 3) was split in two and moved
    up front (to patch 2 and 3);

  * Replacing of TARGET_TB_PCREL (previously patch 2) was split into
    four patches (patches [4,7]), one for each affected submodule;

  * Removal of TARGET_TB_PCREL (previously patch 3) was moved into
    separate patches, one for each submodule (patches [8,10]);

  * Patch 11 was introduced in response to feedback, and removes
    CF_PCREL checks in functions in tb-jmp-cache.h, these functions were
    always called in a context where CF_PCREL was already being checked.
    These tb-jmp-cache.h functions were then removed in favour of manual
    inlining;

  * Patches [12,26] replaces calls to tb_pc() with a member access
    tb->pc, the motivation being that tb_pc() was (almost) always called
    in a context where CF_PCREL was already being checked;

  * Finally patch 27 removes tb_pc() which is no longer used.

Changes in v3:
  * Added reviewed-bys on remaining patches.

Anton Johansson (27):
  include/exec: Introduce `CF_PCREL`
  target/i386: set `CF_PCREL` in `x86_cpu_realizefn`
  target/arm: set `CF_PCREL` in `arm_cpu_realizefn`
  accel/tcg: Replace `TARGET_TB_PCREL` with `CF_PCREL`
  include/exec: Replace `TARGET_TB_PCREL` with `CF_PCREL`
  target/arm: Replace `TARGET_TB_PCREL` with `CF_PCREL`
  target/i386: Replace `TARGET_TB_PCREL` with `CF_PCREL`
  include/exec: Remove `TARGET_TB_PCREL` define
  target/arm: Remove `TARGET_TB_PCREL` define
  target/i386: Remove `TARGET_TB_PCREL` define
  accel/tcg: Move jmp-cache `CF_PCREL` checks to caller
  accel/tcg: Replace `tb_pc()` with `tb->pc`
  target/tricore: Replace `tb_pc()` with `tb->pc`
  target/sparc: Replace `tb_pc()` with `tb->pc`
  target/sh4: Replace `tb_pc()` with `tb->pc`
  target/rx: Replace `tb_pc()` with `tb->pc`
  target/riscv: Replace `tb_pc()` with `tb->pc`
  target/openrisc: Replace `tb_pc()` with `tb->pc`
  target/mips: Replace `tb_pc()` with `tb->pc`
  target/microblaze: Replace `tb_pc()` with `tb->pc`
  target/loongarch: Replace `tb_pc()` with `tb->pc`
  target/i386: Replace `tb_pc()` with `tb->pc`
  target/hppa: Replace `tb_pc()` with `tb->pc`
  target/hexagon: Replace `tb_pc()` with `tb->pc`
  target/avr: Replace `tb_pc()` with `tb->pc`
  target/arm: Replace `tb_pc()` with `tb->pc`
  include/exec: Remove `tb_pc()`

 accel/tcg/cpu-exec.c                    | 64 +++++++++++++++++--------
 accel/tcg/internal.h                    | 10 ++--
 accel/tcg/perf.c                        |  2 +-
 accel/tcg/tb-jmp-cache.h                | 42 +---------------
 accel/tcg/tb-maint.c                    | 10 ++--
 accel/tcg/translate-all.c               | 16 +++----
 include/exec/cpu-defs.h                 |  3 --
 include/exec/exec-all.h                 | 21 ++------
 target/arm/cpu-param.h                  |  2 -
 target/arm/cpu.c                        | 17 ++++---
 target/arm/translate-a64.c              |  8 ++--
 target/arm/translate.c                  |  6 +--
 target/arm/translate.h                  |  2 +-
 target/avr/cpu.c                        |  3 +-
 target/hexagon/cpu.c                    |  4 +-
 target/hppa/cpu.c                       |  8 ++--
 target/i386/cpu-param.h                 |  4 --
 target/i386/cpu.c                       |  5 ++
 target/i386/helper.c                    |  2 +-
 target/i386/tcg/tcg-cpu.c               |  8 ++--
 target/i386/tcg/translate.c             | 26 +++++-----
 target/loongarch/cpu.c                  |  6 ++-
 target/microblaze/cpu.c                 |  4 +-
 target/mips/tcg/exception.c             |  3 +-
 target/mips/tcg/sysemu/special_helper.c |  2 +-
 target/openrisc/cpu.c                   |  4 +-
 target/riscv/cpu.c                      |  7 ++-
 target/rx/cpu.c                         |  3 +-
 target/sh4/cpu.c                        |  6 ++-
 target/sparc/cpu.c                      |  4 +-
 target/tricore/cpu.c                    |  3 +-
 31 files changed, 152 insertions(+), 153 deletions(-)

--
2.39.1


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2023-04-19  8:57 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-27 13:51 [PATCH v3 00/27] Replace TARGET_TB_PCREL with CF_PCREL Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 01/27] include/exec: Introduce `CF_PCREL` Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 02/27] target/i386: set `CF_PCREL` in `x86_cpu_realizefn` Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 03/27] target/arm: set `CF_PCREL` in `arm_cpu_realizefn` Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 04/27] accel/tcg: Replace `TARGET_TB_PCREL` with `CF_PCREL` Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 05/27] include/exec: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 06/27] target/arm: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 07/27] target/i386: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 08/27] include/exec: Remove `TARGET_TB_PCREL` define Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 09/27] target/arm: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 10/27] target/i386: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 11/27] accel/tcg: Move jmp-cache `CF_PCREL` checks to caller Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 12/27] accel/tcg: Replace `tb_pc()` with `tb->pc` Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 13/27] target/tricore: " Anton Johansson via
2023-04-19  8:56   ` Bastian Koppelmann
2023-02-27 13:51 ` [PATCH v3 14/27] target/sparc: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 15/27] target/sh4: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 16/27] target/rx: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 17/27] target/riscv: " Anton Johansson via
2023-02-27 23:05   ` Palmer Dabbelt
2023-02-27 23:08     ` Richard Henderson
2023-02-27 13:51 ` [PATCH v3 18/27] target/openrisc: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 19/27] target/mips: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 20/27] target/microblaze: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 21/27] target/loongarch: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 22/27] target/i386: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 23/27] target/hppa: " Anton Johansson via
2023-02-27 13:51 ` [PATCH v3 24/27] target/hexagon: " Anton Johansson via
2023-02-27 17:24   ` Taylor Simpson
2023-02-27 13:52 ` [PATCH v3 25/27] target/avr: " Anton Johansson via
2023-02-27 13:52 ` [PATCH v3 26/27] target/arm: " Anton Johansson via
2023-02-27 13:52 ` [PATCH v3 27/27] include/exec: Remove `tb_pc()` Anton Johansson via
2023-02-27 19:52 ` [PATCH v3 00/27] Replace TARGET_TB_PCREL with CF_PCREL Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).