Skip to content

RFC build more i386 tcg code modular.

Gerd Hoffmann qemu-arm qemu-devel qemu-riscv 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest29 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/29build: temporarily disable modular tcgmeson.build+1 -10 replies
2/29plugins: register qemu_plugin_opts using opts_init()include/qemu/plugin.h linux-user/main.c plugins/loader.c +1 more+9 -100 replies
3/29tcg/module: move hmp.c to moduleaccel/tcg/meson.build+1 -10 replies
4/29tcg/module: move cputlb.c to moduleaccel/tcg/meson.build+1 -40 replies
5/29tcg/module: move tcg_ss to module [accel/tcg]accel/tcg/meson.build+1 -10 replies
6/29tcg/module: move tcg_ss to module [tcg]tcg/meson.build+1 -10 replies
7/29tcg/module: move files to module [target/i386/tcg]target/i386/tcg/meson.build target/i386/tcg/sysemu/meson.build+11 -30 replies
8/29move cpu-exec-common.c from tcg module to core qemu [accel/tcg]accel/tcg/meson.build+4 -10 replies
9/29tcg/module: add tcg-module.[ch] infrastructureaccel/tcg/meson.build accel/tcg/tcg-module.c include/tcg/tcg-module.h+17 -02 replies
10/29tcg_funcs: Add tlb_flush to TCGModuleOpsaccel/tcg/cpu-exec-common.c accel/tcg/cputlb.c accel/tcg/tcg-module.c +13 more+47 -365 replies
11/29tcg_funcs: Add tlb_flush_page to TCGModuleOpsaccel/tcg/cputlb.c accel/tcg/tcg-module.c include/exec/exec-all.h +3 more+13 -70 replies
12/29tcg_funcs: Add tlb_reset_dirty to TCGModuleOpsaccel/tcg/cputlb.c accel/tcg/tcg-module.c include/exec/exec-all.h +2 more+15 -30 replies
13/29tcg_funcs: Add tlb_plugin_lookup to TCGModuleOpsaccel/tcg/cputlb.c accel/tcg/tcg-module.c include/tcg/tcg-module.h +1 more+14 -20 replies
14/29tcg_funcs:Add tcg_exec_{realizefn,unrealizefn} to TCGModuleOpsaccel/tcg/cpu-exec.c accel/tcg/tcg-module.c cpu.c +2 more+20 -60 replies
15/29tcg_funcs: Add tb_flush to TCGModuleOpsaccel/stubs/tcg-stub.c accel/tcg/tcg-module.c accel/tcg/translate-all.c +11 more+21 -171 reply
16/29tcg: use tb_page_addr_t for tb_invalidate_phys_range()accel/tcg/translate-all.c cpu.c include/exec/exec-all.h +1 more+4 -100 replies
17/29tcg: drop tb_invalidate_phys_page_range()accel/tcg/translate-all.c cpu.c include/exec/translate-all.h+2 -280 replies
18/29tcg_funcs: Add tb_invalidate_phys_range to TCGModuleOpsaccel/tcg/tcg-module.c accel/tcg/translate-all.c cpu.c +4 more+16 -90 replies
19/29tcg_funcs: Add tb_check_watchpoint to TCGModuleOpsaccel/tcg/tcg-module.c accel/tcg/translate-all.c include/exec/translate-all.h +2 more+9 -40 replies
20/29tcg_funcs: Add cpu_restore_state to TCGModuleOpsaccel/tcg/cpu-exec-common.c accel/tcg/tcg-module.c accel/tcg/translate-all.c +17 more+36 -282 replies
21/29tcg_funcs: Add curr_cflags to TCGModuleOpsaccel/tcg/cpu-exec.c accel/tcg/tcg-module.c accel/tcg/translate-all.c +3 more+15 -70 replies
22/29tcg_i386_funcs: Add update_fp_status to TCGI386ModuleOpsaccel/tcg/meson.build accel/tcg/tcg-module-i386.c include/tcg/tcg-module-i386.h +3 more+36 -40 replies
23/29tcg_i386_funcs: Add update_mxcsr_status to TCGI386ModuleOpsaccel/tcg/tcg-module-i386.c include/tcg/tcg-module-i386.h target/i386/cpu.h +2 more+6 -40 replies
24/29tcg_i386_funcs: Add update_mxcsr_from_sse_status to TCGI386ModuleOpsaccel/tcg/tcg-module-i386.c include/tcg/tcg-module-i386.h target/i386/cpu-dump.c +5 more+8 -340 replies
25/29tcg_i386_funcs: Add x86_register_ferr_irq to TCGI386ModuleOpsaccel/tcg/tcg-module-i386.c hw/i386/pc_piix.c hw/i386/pc_q35.c +3 more+16 -50 replies
26/29tcg_i386_funcs: Add cpu_set_ignne to TCGI386ModuleOpsaccel/tcg/tcg-module-i386.c hw/i386/pc.c include/tcg/tcg-module-i386.h +2 more+9 -30 replies
27/29tcg_i386_funcs: Add cpu_x86_update_dr7 to TCGI386ModuleOpsaccel/tcg/tcg-module-i386.c include/tcg/tcg-module-i386.h target/i386/cpu.h +3 more+16 -40 replies
28/29tcg_i386_funcs: Add cpu_cc_compute_all to TCGI386ModuleOpsaccel/tcg/tcg-module-i386.c include/tcg/tcg-module-i386.h target/i386/cpu.h +6 more+31 -190 replies
29/29Revert "build: temporarily disable modular tcg"meson.build+1 -10 replies

Reviews trailers per patch

2 of 29 patches have a Reviewed-by or Acked-by.

PatchDavid GibsonBastian KoppelmannGreg Kurz
1/29
2/29
3/29
4/29
5/29
6/29
7/29
8/29
9/29
10/29
11/29
12/29
13/29
14/29
15/29A-b
16/29
17/29
18/29
19/29
20/29A-b R-b
21/29
22/29
23/29
24/29
25/29
26/29
27/29
28/29
29/29

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

Read the v1 thread

Cover letter [PATCH 00/29] [RFC] build more i386 tcg code modular.

This series moves a big pile of code from core qemu to the tcg module.

To allow for more fine-grained patches the first patch disables modular tcg and the last patch re-enables it. Alternatively we could move all the build system changes (patches 4-8) to the end of the series and squash them into a single patch. Not sure which is better ...

The fundamental idea of this series is that any call from core qemu into tcg gets routed through function pointers. This is simliar to the way we handle the spice module (see ui/spice-module.c).

Initially the function pointers are filled with stubs, when the tcg module loads all function pointers are updated to point to the real functions instead. One side effect of this is that compile-time stubs will become runtime-stubs.

Series overview:

   1         - disable modular tcg.
   2 =>  3   - misc small tweaks.
   4 =>  8   - build system changes.
   9 => 21   - add generic tcg function pointers.
  22 => 28   - add i386 tcg function pointers.
  29         - re-enable modular tcg.

take care,
Gerd

Gerd Hoffmann (29):
build: temporarily disable modular tcg
plugins: register qemu_plugin_opts using opts_init() tcg/module: move hmp.c to module
tcg/module: move cputlb.c to module
tcg/module: move tcg_ss to module [accel/tcg]
tcg/module: move tcg_ss to module [tcg]
tcg/module: move files to module [target/i386/tcg]
move cpu-exec-common.c from tcg module to core qemu [accel/tcg] tcg/module: add tcg-module.[ch] infrastructure
tcg_funcs: Add tlb_flush to TCGModuleOps
tcg_funcs: Add tlb_flush_page to TCGModuleOps
tcg_funcs: Add tlb_reset_dirty to TCGModuleOps
tcg_funcs: Add tlb_plugin_lookup to TCGModuleOps tcg_funcs:Add tcg_exec_{realizefn,unrealizefn} to TCGModuleOps
tcg_funcs: Add tb_flush to TCGModuleOps
tcg: use tb_page_addr_t for tb_invalidate_phys_range()
tcg: drop tb_invalidate_phys_page_range()
tcg_funcs: Add tb_invalidate_phys_range to TCGModuleOps
tcg_funcs: Add tb_check_watchpoint to TCGModuleOps
tcg_funcs: Add cpu_restore_state to TCGModuleOps
tcg_funcs: Add curr_cflags to TCGModuleOps
tcg_i386_funcs: Add update_fp_status to TCGI386ModuleOps
tcg_i386_funcs: Add update_mxcsr_status to TCGI386ModuleOps
tcg_i386_funcs: Add update_mxcsr_from_sse_status to TCGI386ModuleOps
tcg_i386_funcs: Add x86_register_ferr_irq to TCGI386ModuleOps
tcg_i386_funcs: Add cpu_set_ignne to TCGI386ModuleOps
tcg_i386_funcs: Add cpu_x86_update_dr7 to TCGI386ModuleOps
tcg_i386_funcs: Add cpu_cc_compute_all to TCGI386ModuleOps Revert "build: temporarily disable modular tcg"

 include/exec/cpu-all.h              |  2 -
 include/exec/exec-all.h             | 16 ++------
 include/exec/ram_addr.h             |  2 -
 include/exec/translate-all.h        |  2 -
 include/qemu/plugin.h               |  7 ----
 include/tcg/tcg-module-i386.h       | 15 ++++++++
 include/tcg/tcg-module.h            | 24 ++++++++++++
 target/i386/cpu.h                   | 17 ++------
 accel/stubs/tcg-stub.c              |  4 --
 accel/tcg/cpu-exec-common.c         | 10 ++++-
 accel/tcg/cpu-exec.c                | 15 ++++++--
 accel/tcg/cputlb.c                  | 14 ++++++-
 accel/tcg/tcg-module-i386.c         | 33 ++++++++++++++++
 accel/tcg/tcg-module.c              | 60 +++++++++++++++++++++++++++++
 accel/tcg/translate-all.c           | 55 +++++++-------------------
 cpu.c                               | 14 +++----
 gdbstub.c                           |  4 +-
 hw/i386/pc.c                        |  2 +-
 hw/i386/pc_piix.c                   |  2 +-
 hw/i386/pc_q35.c                    |  2 +-
 hw/ppc/spapr_hcall.c                |  2 +-
 linux-user/main.c                   |  2 +-
 linux-user/mmap.c                   |  8 ++--
 linux-user/syscall.c                |  4 +-
 plugins/api.c                       |  4 +-
 plugins/core.c                      |  2 +-
 plugins/loader.c                    | 11 +++++-
 softmmu/physmem.c                   | 22 +++++------
 softmmu/vl.c                        |  1 -
 target/alpha/helper.c               |  2 +-
 target/alpha/mem_helper.c           |  2 +-
 target/alpha/sys_helper.c           |  2 +-
 target/arm/helper.c                 | 26 ++++++-------
 target/arm/op_helper.c              |  2 +-
 target/arm/tlb_helper.c             |  8 ++--
 target/cris/helper.c                |  2 +-
 target/i386/cpu-dump.c              |  2 +-
 target/i386/gdbstub.c               |  2 +-
 target/i386/helper.c                | 10 ++---
 target/i386/machine.c               |  8 ++--
 target/i386/tcg/cc_helper.c         |  9 ++++-
 target/i386/tcg/fpu_helper.c        | 23 +++++++----
 target/i386/tcg/int_helper.c        |  8 ++--
 target/i386/tcg/mem_helper.c        |  8 ++--
 target/i386/tcg/misc_helper.c       |  4 +-
 target/i386/tcg/seg_helper.c        | 10 ++---
 target/i386/tcg/sysemu/bpt_helper.c |  9 ++++-
 target/i386/tcg/sysemu/fpu_helper.c | 12 +++++-
 target/i386/tcg/sysemu/svm_helper.c |  2 +-
 target/i386/tcg/tcg-stub.c          | 25 ------------
 target/m68k/op_helper.c             |  6 +--
 target/microblaze/helper.c          |  2 +-
 target/mips/sysemu/cp0.c            |  2 +-
 target/openrisc/sys_helper.c        |  8 ++--
 target/ppc/excp_helper.c            |  2 +-
 target/riscv/csr.c                  |  2 +-
 target/s390x/gdbstub.c              |  2 +-
 target/s390x/sigp.c                 |  2 +-
 target/s390x/tcg/excp_helper.c      |  2 +-
 target/tricore/op_helper.c          |  2 +-
 target/xtensa/helper.c              |  6 +--
 accel/tcg/meson.build               | 24 ++++++++----
 target/i386/tcg/meson.build         |  7 +++-
 target/i386/tcg/sysemu/meson.build  |  5 ++-
 tcg/meson.build                     |  2 +-
 65 files changed, 367 insertions(+), 239 deletions(-)
 create mode 100644 include/tcg/tcg-module-i386.h
 create mode 100644 include/tcg/tcg-module.h
 create mode 100644 accel/tcg/tcg-module-i386.c
 create mode 100644 accel/tcg/tcg-module.c
 delete mode 100644 target/i386/tcg/tcg-stub.c
Signature · 1 line
2.31.1