On 1/23/21 11:26 AM, Stefan Weil wrote: > Am 23.01.21 um 09:59 schrieb Wataru Ashihara: > >> Actually I use TCI also on macOS. Like the use case quoted by Philippe, >> there're even other reasons to use TCI: >> >> 1. Learning TCG ops. >> 2. Debugging QEMU with gdb. e.g. diagnose codegen or stepping into >> helper functions from tci.c:tcg_qemu_tb_exec(). >> 3. Guest instruction tracing. TCI is faster than TCG or KVM when tracing >> the guest ops [1]. I guess qira is using TCI for this reason [2]. >> >> [1]: https://twitter.com/wata_ash/status/1352899988032942080 >> [2]: https://github.com/geohot/qira/blob/v1.3/tracers/qemu_build.sh#L55 > > > Yes, TCI can help a lot for debugging, especially also when porting TCG > to a new host architecture.
Indeed, Alistair used it to boostrap RISCV: https://www.mail-archive.com/qemu-devel@nongnu.org/msg552643.html Worth citing a comment Peter mentioned at the end of this thread: "the interpreter [...] only works with a subset of host OS calling convention ABIs". https://www.mail-archive.com/qemu-devel@nongnu.org/msg553077.html > If we had binaries which can switch from native to interpreted TCG, it > could also be a reference implementation used for unit tests, comparing > the results for each TCG opcode. > > Using TCI with profiling like gprof is useful to count the frequency of > the different TCG opcodes in practical scenarios and can be used to > detect bottlenecks (and less frequent or unused opcodes) for native TCG, > too. > > Stefan > > >