unicorn/qemu/include
Emilio G. Cota 5ad6116f20
tcg: allocate optimizer temps with tcg_malloc
Groundwork for supporting multiple TCG contexts.

While at it, also allocate temps_used directly as a bitmap of the
required size, instead of using a bitmap of TCG_MAX_TEMPS via
TCGTempSet.

Performance-wise we lose about 1.12% in a translation-heavy workload
such as booting+shutting down debian-arm:

Performance counter stats for 'taskset -c 0 arm-softmmu/qemu-system-arm \
-machine type=virt -nographic -smp 1 -m 4096 \
-netdev user,id=unet,hostfwd=tcp::2222-:22 \
-device virtio-net-device,netdev=unet \
-drive file=die-on-boot.qcow2,id=myblock,index=0,if=none \
-device virtio-blk-device,drive=myblock \
-kernel kernel.img -append console=ttyAMA0 root=/dev/vda1 \
-name arm,debug-threads=on -smp 1' (10 runs):

exec time (s) Relative slowdown wrt original (%)
---------------------------------------------------------------
original 20.213321616 0.
tcg_malloc 20.441130078 1.1270214
TCGContext 20.477846517 1.3086662
g_malloc 20.780527895 2.8061013

The other two alternatives shown in the table are:
- TCGContext: embed temps[TCG_MAX_TEMPS] and TCGTempSet used_temps
in TCGContext. This is simple enough but it isn't faster than using
tcg_malloc; moreover, it wastes memory.
- g_malloc: allocate/deallocate both temps and used_temps every time
tcg_optimize is executed.

Backports commit 34184b071817b4f9edbfd1aa2225c196f05a0947 from qemu
2018-03-14 12:10:28 -04:00
..
crypto Drop unused crypto source files 2018-02-17 15:23:57 -05:00
exec exec-all: rename tb_free to tb_remove 2018-03-13 16:20:41 -04:00
fpu configure: Drop ancient Solaris 9 and earlier support 2018-03-09 12:14:21 -05:00
hw machine: use class base init generated name 2018-03-11 16:54:40 -04:00
qapi qdict: Introduce qdict_rename_keys() 2018-03-12 10:11:48 -04:00
qemu tcg: allocate optimizer temps with tcg_malloc 2018-03-14 12:10:28 -04:00
qom tcg: Add CPUState cflags_next_tb 2018-03-13 14:39:43 -04:00
sysemu tcg: add options for enabling MTTCG 2018-03-02 09:25:01 -05:00
config.h import 2015-08-21 15:04:50 +08:00
elf.h include/elf: Update elf.h to commit f71a8eaffba3271cf7cdad95572f6996f7523a5b 2018-03-11 15:34:35 -04:00
glib_compat.h translate-all: use a binary search tree to track TBs in TBContext 2018-03-13 16:18:29 -04:00
qemu-common.h tcg: Add EXCP_ATOMIC 2018-02-27 11:57:58 -05:00