qemu-patch-raspberry4/include
Emilio G. Cota 6e3b2bfd6a tcg: allocate TB structs before the corresponding translated code
Allocating an arbitrarily-sized array of tbs results in either
(a) a lot of memory wasted or (b) unnecessary flushes of the code
cache when we run out of TB structs in the array.

An obvious solution would be to just malloc a TB struct when needed,
and keep the TB array as an array of pointers (recall that tb_find_pc()
needs the TB array to run in O(log n)).

Perhaps a better solution, which is implemented in this patch, is to
allocate TB's right before the translated code they describe. This
results in some memory waste due to padding to have code and TBs in
separate cache lines--for instance, I measured 4.7% of padding in the
used portion of code_gen_buffer when booting aarch64 Linux on a
host with 64-byte cache lines. However, it can allow for optimizations
in some host architectures, since TCG backends could safely assume that
the TB and the corresponding translated code are very close to each
other in memory. See this message by rth for a detailed explanation:

  https://lists.gnu.org/archive/html/qemu-devel/2017-03/msg05172.html
  Subject: Re: GSoC 2017 Proposal: TCG performance enhancements
  Message-ID: <1e67644b-4b30-887e-d329-1848e94c9484@twiddle.net>

Suggested-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <1496790745-314-3-git-send-email-cota@braap.org>
[rth: Simplify the arithmetic in tcg_tb_alloc]
Signed-off-by: Richard Henderson <rth@twiddle.net>
2017-06-19 11:10:59 -07:00
..
block nbd/client.c: use errp instead of LOG 2017-06-06 20:18:36 +02:00
chardev char: fix alias devices regression 2017-06-08 17:57:36 +04:00
crypto crypto: qcrypto_random_bytes() now works on windows w/o any other crypto libs 2017-05-09 14:41:47 +01:00
disas Fix Thumb-1 BE32 execution and disassembly. 2017-02-07 18:29:59 +00:00
exec tcg: allocate TB structs before the corresponding translated code 2017-06-19 11:10:59 -07:00
fpu softfloat: Add float128_to_uint32_round_to_zero() 2017-02-22 11:28:28 +11:00
hw hw/intc/arm_gicv3_its: Implement state save/restore 2017-06-13 14:57:00 +01:00
io trivial patches for 2017-05-10 2017-05-10 12:31:19 -04:00
libdecnumber Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
migration migration: Remove unneeded includes 2017-06-14 11:10:19 +02:00
monitor qmp: Dumb down how we run QMP command registration 2017-03-05 09:02:10 +01:00
net slirp: add a fake NC-SI backend 2017-04-25 19:17:25 +08:00
qapi qapi: Document visit_type_any() issues with keyval input 2017-05-31 16:04:05 +02:00
qemu util: add cacheinfo 2017-06-19 11:10:59 -07:00
qom numa: move numa_node from CPUState into target specific classes 2017-06-05 14:59:09 -03:00
standard-headers linux-headers: update 2017-05-19 12:29:01 +02:00
sysemu kvm-all: Pass an error object to kvm_device_access 2017-06-13 14:57:00 +01:00
ui opengl: add egl-headless display 2017-05-12 12:02:48 +02:00
elf.h nios2: Add usermode binaries emulation 2017-01-24 13:10:35 -08:00
glib-compat.h qga: Add 'guest-get-users' command 2017-04-26 23:57:45 -05:00
qemu-common.h utils: provide size_to_str() 2017-05-17 17:30:45 +01:00
qemu-io.h hmp: Request permissions in qemu-io 2017-02-28 20:47:50 +01:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00