- Oct 28, 2019
-
-
Alex Bennée authored
Having the plugins grab stdout and spew stuff there is a bit ugly and certainly makes the tests look ugly. Provide a hook back into QEMU which can be redirected as needed. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Aaron Lindsay <aaron@os.amperecomputing.com>
-
Alex Bennée authored
Give the plugins access to the QEMU dissasembler so they don't have to re-invent the wheel. We generate a warning when there are spare bytes in the decode buffer. This is usually due to the front end loading in more bytes than decoded. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Alex Bennée authored
This provides a limited amount of info to plugins about the guest system that will allow them to make some additional decisions on setup. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> [AJB: moved into plugins] Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Alex Bennée authored
This adds the basic boilerplate feature enable option for the build. We shall expand it later. [AJB: split from larger patch] Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Acked-by:
Palmer Dabbelt <palmer@sifive.com>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
There is a small wrinkle with the gUSA instruction. The translator effectively treats a (known) gUSA sequence as a single instruction. For the purposes of the plugin we end up with a long multi-instruction qemu_plugin_insn. If the known sequence isn't detected we shall never run this translation anyway. Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Acked-by:
David Gibson <david@gibson.dropbear.id.au> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
Now the arm_ld*_code functions are only used at translate time we can just pass down to translator_ld functions. Signed-off-by:
Emilio G. Cota <cota@braap.org> [AJB: convert from plugin_insn_append to translator_ld] Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
We don't bother with replicating the fast path (tlb_hit) of the old cpu_ldst helpers as it has no measurable effect on performance. This probably indicates we should consider flattening the whole set of helpers but that is out of scope for this change. Suggested-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Emilio G. Cota <cota@braap.org> [AJB: directly plumb into softmmu/user helpers] Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Alex Bennée authored
We document this in docs/devel/load-stores.rst so lets follow it. The 32 bit and 64 bit access functions have historically not included the sign so we leave those as is. We also introduce some signed helpers which are used for loading immediate values in the translator. Fixes: 282dffc8 Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Message-Id: <20191021150910.23216-1-alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
By adding it to plugin-gen's header file, we can export is as an inline, since tcg.h is included in the header (we need tcg_ctx). Signed-off-by:
Emilio G. Cota <cota@braap.org> [AJB: use g_byte_array] Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
To avoid too much duplication add a wrapper that the existing trace and the new plugin calls can live in. We could move the -strace code here as well but that is left for a future series as the code is subtly different between the bsd and linux. Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> [AJB: wrap in syscall-trace.h, expand commit msg] Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
Plugins might allocate per-TB data that then they get passed each time a TB is executed (via the *userdata pointer). Notify plugin code every time a code cache flush occurs, so that plugins can then reclaim the memory of the per-TB data. Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Alex Bennée authored
We need to keep a local per-cpu copy of the data as other threads may be running. Currently we can provide insight as to if the access was IO or not and give the offset into a given device (usually the main RAMBlock). We store enough information to get details such as the MemoryRegion which might be useful in later expansions to the API. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
To capture all memory accesses we need hook into all the various helper functions that are involved in memory operations as well as the injected inline helper calls. A later commit will allow us to resolve the actual guest HW addresses by replaying the lookup. Signed-off-by:
Emilio G. Cota <cota@braap.org> [AJB: drop haddr handling, just deal in vaddr] Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
In preparation for plugin support. Signed-off-by:
Emilio G. Cota <cota@braap.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
We first inject empty instrumentation from translator_loop. After translation, we go through the plugins to see what they want to register for, filling in the empty instrumentation. If if turns out that some instrumentation remains unused, we remove it. This approach supports the following features: - Inlining TCG code for simple operations. Note that we do not export TCG ops to plugins. Instead, we give them a C API to insert inlined ops. So far we only support adding an immediate to a u64, e.g. to count events. - "Direct" callbacks. These are callbacks that do not go via a helper. Instead, the helper is defined at run-time, so that the plugin code is directly called from TCG. This makes direct callbacks as efficient as possible; they are therefore used for very frequent events, e.g. memory callbacks. - Passing the host address to memory callbacks. Most of this is implemented in a later patch though. - Instrumentation of memory accesses performed from helpers. See the corresponding comment, as well as a later patch. Signed-off-by:
Emilio G. Cota <cota@braap.org> [AJB: add alloc_tcg_plugin_context, use glib, rm hwaddr] Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
Will gain a user soon. Signed-off-by:
Emilio G. Cota <cota@braap.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
This will be used by plugins to get the host address of instructions. Signed-off-by:
Emilio G. Cota <cota@braap.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
Suggested-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Emilio G. Cota <cota@braap.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
This is faster than removing elements one by one. Will gain a user soon. Signed-off-by:
Emilio G. Cota <cota@braap.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Alex Bennée authored
[AJB: split from the core code commit] Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
Signed-off-by:
Emilio G. Cota <cota@braap.org> [AJB: moved directory and merged various fixes] Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
Add the API first to ease review. Signed-off-by:
Emilio G. Cota <cota@braap.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Alex Bennée authored
This is mostly extracted from Emilio's more verbose commit comments with some additional verbiage from me. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
tb_flush will be called by the plugin module from a safe work environment. Prepare for that. Suggested-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Emilio G. Cota <cota@braap.org> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Emilio G. Cota authored
Suggested-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Emilio G. Cota <cota@braap.org> [AJB: moved inside start/end_exclusive fns + cleanup] Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
Alex Bennée authored
We are going to re-use mem_info later for plugins and will need to track the mmu_idx for softmmu code. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Emilio G. Cota authored
This will allow us to trace 32k-long memory accesses (although our maximum is something like 256 bytes at the moment). Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Emilio G. Cota <cota@braap.org> [AJB: expanded to 3->4 bits] Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-