qemu-patch-raspberry4/accel/tcg
Emilio G. Cota 0aecede612 tcg: fix corruption of code_time profiling counter upon tb_flush
Whenever there is an overflow in code_gen_buffer (e.g. we run out
of space in it and have to flush it), the code_time profiling counter
ends up with an invalid value (that is, code_time -= profile_getclock(),
without later on getting += profile_getclock() due to the goto).

Fix it by using the ti variable, so that we only update code_time
when there is no overflow. Note that in case there is an overflow
we fail to account for the elapsed coding time, but this is quite rare
so we can probably live with it.

"info jit" before/after, roughly at the same time during debian-arm bootup:

- before:
Statistics:
TB flush count      1
TB invalidate count 4665
TLB flush count     998
JIT cycles          -615191529184601 (-256329.804 s at 2.4 GHz)
translated TBs      302310 (aborted=0 0.0%)
avg ops/TB          48.4 max=438
deleted ops/TB      8.54
avg temps/TB        32.31 max=38
avg host code/TB    361.5
avg search data/TB  24.5
cycles/op           -42014693.0
cycles/in byte      -121444900.2
cycles/out byte     -5629031.1
cycles/search byte     -83114481.0
  gen_interm time   -0.0%
  gen_code time     100.0%
optim./code time    -0.0%
liveness/code time  -0.0%
cpu_restore count   6236
  avg cycles        110.4

- after:
Statistics:
TB flush count      1
TB invalidate count 4665
TLB flush count     1010
JIT cycles          1996899624 (0.832 s at 2.4 GHz)
translated TBs      297961 (aborted=0 0.0%)
avg ops/TB          48.5 max=438
deleted ops/TB      8.56
avg temps/TB        32.31 max=38
avg host code/TB    361.8
avg search data/TB  24.5
cycles/op           138.2
cycles/in byte      398.4
cycles/out byte     18.5
cycles/search byte     273.1
  gen_interm time   14.0%
  gen_code time     86.0%
optim./code time    19.4%
liveness/code time  10.3%
cpu_restore count   6372
  avg cycles        111.0

Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2017-10-10 07:37:10 -07:00
..
atomic_template.h accel/tcg: move atomic_template.h to accel/tcg/ 2017-09-17 06:52:19 -07:00
cpu-exec-common.c tcg: make tcg_allowed global 2017-07-04 16:01:16 +02:00
cpu-exec.c tcg: Move USE_DIRECT_JUMP discriminator to tcg/cpu/tcg-target.h 2017-09-07 11:57:34 -07:00
cputlb.c cputlb: bring back tlb_flush_count under !TLB_DEBUG 2017-10-10 07:37:10 -07:00
Makefile.objs accel/tcg: move tcg-runtime to accel/tcg/ 2017-09-17 06:52:19 -07:00
softmmu_template.h accel/tcg: move softmmu_template.h to accel/tcg/ 2017-09-17 06:52:19 -07:00
tcg-all.c tcg: make tcg_allowed global 2017-07-04 16:01:16 +02:00
tcg-runtime.c accel/tcg: move USER code to user-exec.c 2017-09-17 06:52:19 -07:00
tcg-runtime.h accel/tcg: move tcg-runtime to accel/tcg/ 2017-09-17 06:52:19 -07:00
trace-events trace-events: fix code style: print 0x before hex numbers 2017-08-01 12:13:07 +01:00
translate-all.c tcg: fix corruption of code_time profiling counter upon tb_flush 2017-10-10 07:37:10 -07:00
translate-all.h tcg: move tcg backend files into accel/tcg/ 2017-06-15 11:04:06 +02:00
translator.c tcg: Add generic translation framework 2017-09-06 08:06:47 -07:00
user-exec-stub.c accel/tcg: move user-exec to accel/tcg/ 2017-09-17 06:52:19 -07:00
user-exec.c accel/tcg: move USER code to user-exec.c 2017-09-17 06:52:19 -07:00