On 29/07/21 11:14, Gerd Hoffmann wrote:
The common functions could be added TCGCPUOps to allow them being called via CPUClass->tcg_ops->$name instead of a direct symbol reference. Not sure this is a good idea though. Experimental patch covering tcg_exec_realizefn + tcg_exec_unrealizefn below.
A lot of these (though probably not all) are already stubbed out as "static inline" in include/exec/exec-all.h. I think they can be changed to function pointers in the style of ui/spice-module.c (accel/tcg/tcg-module.c?).
No idea yet how to handle arch-specific bits best. Seems there is no existing infrastructure to untangle target-specific code and tcg, so this probably needs something new.
If they are few enough, I would just move them out of target/i386/tcg and into target/i386/cpu-sysemu.c.
Noticed softmmu/physmem.c has lots of CONFIG_TCG #ifdefs, splitting this into softmmu/physmem-{common,tcg}.c is probably a good idea.
I only count one, and those function should be easily moved to accel/tcg/cputlb.c (after all both physmem.c and cputlb.c used to be a single file, exec.c, so this is just an oversight).
Paolo