Skip to content

Replace TARGET_TB_PCREL with CF_PCREL

Anton Johansson via qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest27 patches 5 repliesIn review
  2. v227 patches 1 replySuperseded
  3. v13 patches 7 repliesSuperseded

Changes in v3 from the cover letter

* Added reviewed-bys on remaining patches.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/27include/exec: Introduce `CF_PCREL`include/exec/exec-all.h+1 -00 replies
2/27target/i386: set `CF_PCREL` in `x86_cpu_realizefn`target/i386/cpu.c+5 -00 replies
3/27target/arm: set `CF_PCREL` in `arm_cpu_realizefn`target/arm/cpu.c+5 -00 replies
4/27accel/tcg: Replace `TARGET_TB_PCREL` with `CF_PCREL`accel/tcg/cpu-exec.c accel/tcg/internal.h accel/tcg/perf.c +3 more+44 -460 replies
5/27include/exec: Replace `TARGET_TB_PCREL` with `CF_PCREL`include/exec/exec-all.h+11 -160 replies
6/27target/arm: Replace `TARGET_TB_PCREL` with `CF_PCREL`target/arm/cpu.c target/arm/translate-a64.c target/arm/translate.c +1 more+12 -120 replies
7/27target/i386: Replace `TARGET_TB_PCREL` with `CF_PCREL`target/i386/helper.c target/i386/tcg/tcg-cpu.c target/i386/tcg/translate.c+17 -170 replies
8/27include/exec: Remove `TARGET_TB_PCREL` defineinclude/exec/cpu-defs.h+0 -30 replies
9/27target/arm: Remove `TARGET_TB_PCREL` definetarget/arm/cpu-param.h+0 -20 replies
10/27target/i386: Remove `TARGET_TB_PCREL` definetarget/i386/cpu-param.h+0 -40 replies
11/27accel/tcg: Move jmp-cache `CF_PCREL` checks to calleraccel/tcg/cpu-exec.c accel/tcg/tb-jmp-cache.h+41 -510 replies
12/27accel/tcg: Replace `tb_pc()` with `tb->pc`accel/tcg/cpu-exec.c accel/tcg/internal.h accel/tcg/tb-maint.c +1 more+10 -100 replies
13/27target/tricore: Replace `tb_pc()` with `tb->pc`target/tricore/cpu.c+2 -11 reply
14/27target/sparc: Replace `tb_pc()` with `tb->pc`target/sparc/cpu.c+3 -10 replies
15/27target/sh4: Replace `tb_pc()` with `tb->pc`target/sh4/cpu.c+4 -20 replies
16/27target/rx: Replace `tb_pc()` with `tb->pc`target/rx/cpu.c+2 -10 replies
17/27target/riscv: Replace `tb_pc()` with `tb->pc`target/riscv/cpu.c+5 -22 replies
18/27target/openrisc: Replace `tb_pc()` with `tb->pc`target/openrisc/cpu.c+3 -10 replies
19/27target/mips: Replace `tb_pc()` with `tb->pc`target/mips/tcg/exception.c target/mips/tcg/sysemu/special_helper.c+3 -20 replies
20/27target/microblaze: Replace `tb_pc()` with `tb->pc`target/microblaze/cpu.c+3 -10 replies
21/27target/loongarch: Replace `tb_pc()` with `tb->pc`target/loongarch/cpu.c+4 -20 replies
22/27target/i386: Replace `tb_pc()` with `tb->pc`target/i386/tcg/tcg-cpu.c+1 -10 replies
23/27target/hppa: Replace `tb_pc()` with `tb->pc`target/hppa/cpu.c+5 -30 replies
24/27target/hexagon: Replace `tb_pc()` with `tb->pc`target/hexagon/cpu.c+3 -11 reply
25/27target/avr: Replace `tb_pc()` with `tb->pc`target/avr/cpu.c+2 -10 replies
26/27target/arm: Replace `tb_pc()` with `tb->pc`target/arm/cpu.c+2 -20 replies
27/27include/exec: Remove `tb_pc()`include/exec/exec-all.h+0 -70 replies

Reviews trailers per patch

All 27 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-DaudéRichard HendersonTaylor SimpsonPalmer DabbeltBastian Koppelmann
1/27R-b R-b
2/27R-b
3/27R-b
4/27R-b
5/27R-b
6/27R-b
7/27R-b
8/27R-b
9/27R-b
10/27R-b
11/27R-b
12/27R-b
13/27R-b R-b
14/27R-b
15/27R-b
16/27R-b
17/27R-b R-b A-b
18/27R-b
19/27R-b
20/27R-b
21/27R-b
22/27R-b
23/27R-b
24/27R-b R-b
25/27R-b
26/27R-b
27/27R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/27] Replace TARGET_TB_PCREL with CF_PCREL

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