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 -- 2.31.1