- May 19, 2016
-
-
Paolo Bonzini authored
exec-all.h contains TCG-specific definitions. It is not needed outside TCG-specific files such as translate.c, exec.c or *helper.c. One generic function had snuck into include/exec/exec-all.h; move it to include/qom/cpu.h. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
TCG backends do not need most of exec-all.h; extract what they actually need to a separate file or move it directly to tcg.h. The next patch will stop including exec-all.h from everywhere. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- May 18, 2016
-
-
Stefan Weil authored
Signed-off-by:
Stefan Weil <sw@weilnetz.de> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- May 13, 2016
-
-
Sergey Fedorov authored
The value returned from tcg_qemu_tb_exec() is the value passed to the corresponding tcg_gen_exit_tb() at translation time of the last TB attempted to execute. It is a little confusing to store it in a variable named 'next_tb'. In fact, it is a combination of 4-byte aligned pointer and additional information in its two least significant bits. Break it down right away into two variables named 'last_tb' and 'tb_exit' which are a pointer to the last TB attempted to execute and the TB exit reason, correspondingly. This simplifies the code and improves its readability. Correct a misleading documentation comment for tcg_qemu_tb_exec() and fix logging in cpu_tb_exec(). Also rename a misleading 'next_tb' in another couple of places. Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by:
Sergey Fedorov <sergey.fedorov@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Sergey Fedorov authored
In user mode, there's only a static address translation, TBs are always invalidated properly and direct jumps are reset when mapping change. Thus the destination address is always valid for direct jumps and there's no need to restrict it to the pages the TB resides in. Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by:
Sergey Fedorov <sergey.fedorov@linaro.org> Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Blue Swirl <blauwirbel@gmail.com> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Sergey Fedorov authored
We don't take care of direct jumps when address mapping changes. Thus we must be sure to generate direct jumps so that they always keep valid even if address mapping changes. Luckily, we can only allow to execute a TB if it was generated from the pages which match with current mapping. Document tcg_gen_goto_tb() declaration and note the reason for destination PC limitations. Some targets with variable length instructions allow TB to straddle a page boundary. However, we make sure that both of TB pages match the current address mapping when looking up TBs. So it is safe to do direct jumps into the both pages. Correct the checks for some of those targets. Given that, we can safely patch a TB which spans two pages. Remove the unnecessary check in cpu_exec() and allow such TBs to be patched. Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by:
Sergey Fedorov <sergey.fedorov@linaro.org> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Sergey Fedorov authored
Briefly describe in a comment how direct block chaining is done. It should help in understanding of the following data fields. Rename some fields in TranslationBlock and TCGContext structures to better reflect their purpose (dropping excessive 'tb_' prefix in TranslationBlock but keeping it in TCGContext): tb_next_offset => jmp_reset_offset tb_jmp_offset => jmp_insn_offset tb_next => jmp_target_addr jmp_next => jmp_list_next jmp_first => jmp_list_first Avoid using a magic constant as an invalid offset which is used to indicate that there's no n-th jump generated. Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by:
Sergey Fedorov <sergey.fedorov@linaro.org> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Sergey Fedorov authored
Ensure direct jump patching in MIPS is atomic by using atomic_read()/atomic_set() for code patching. Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by:
Sergey Fedorov <sergey.fedorov@linaro.org> Message-Id: <1461341333-19646-11-git-send-email-sergey.fedorov@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net> [rth: Merged the deposit32 followup.] [rth: Merged the following followup.] Message-Id: <1462210518-26522-1-git-send-email-sergey.fedorov@linaro.org>
-
Sergey Fedorov authored
Ensure direct jump patching in SPARC is atomic by using atomic_read()/atomic_set() for code patching. Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by:
Sergey Fedorov <sergey.fedorov@linaro.org> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Message-Id: <1461341333-19646-10-git-send-email-sergey.fedorov@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Sergey Fedorov authored
Ensure direct jump patching in AArch64 is atomic by using atomic_read()/atomic_set() for code patching. Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by:
Sergey Fedorov <sergey.fedorov@linaro.org> Message-Id: <1461341333-19646-9-git-send-email-sergey.fedorov@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Sergey Fedorov authored
Ensure direct jump patching in ARM is atomic by using atomic_read()/atomic_set() for code patching. Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by:
Sergey Fedorov <sergey.fedorov@linaro.org> Message-Id: <1461341333-19646-8-git-send-email-sergey.fedorov@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Sergey Fedorov authored
Ensure direct jump patching in s390 is atomic by: * naturally aligning a location of direct jump address; * using atomic_read()/atomic_set() for code patching. Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by:
Sergey Fedorov <sergey.fedorov@linaro.org> Message-Id: <1461341333-19646-7-git-send-email-sergey.fedorov@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Sergey Fedorov authored
Ensure direct jump patching in i386 is atomic by: * naturally aligning a location of direct jump address; * using atomic_read()/atomic_set() for code patching. tcg_out_nopn() implementation: Suggested-by:
Richard Henderson <rth@twiddle.net>.> Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by:
Sergey Fedorov <sergey.fedorov@linaro.org> Message-Id: <1461341333-19646-6-git-send-email-sergey.fedorov@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Sergey Fedorov authored
Ensure direct jump patching in PPC is atomic by: * limiting translation buffer size in 32-bit mode to be addressable by Branch I-form instruction; * using atomic_read()/atomic_set() for code patching. Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by:
Sergey Fedorov <sergey.fedorov@linaro.org> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Message-Id: <1461341333-19646-5-git-send-email-sergey.fedorov@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Sergey Fedorov authored
Ensure direct jump patching in TCI is atomic by: * naturally aligning a location of direct jump address; * using atomic_read()/atomic_set() to load/store the address. Signed-off-by:
Sergey Fedorov <serge.fdrv@gmail.com> Signed-off-by:
Sergey Fedorov <sergey.fedorov@linaro.org> Message-Id: <1461341333-19646-4-git-send-email-sergey.fedorov@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
- May 12, 2016
-
-
Edgar E. Iglesias authored
Add tcg_set_insn_param as a mechanism to modify an insn parameter after emiting the insn. This is useful for icount and also for embedding fault information for a specific insn. Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Edgar E. Iglesias <edgar.iglesias@xilinx.com> Message-id: 1461931684-1867-2-git-send-email-edgar.iglesias@gmail.com Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Apr 21, 2016
-
-
Aurelien Jarno authored
Check for CONFIG_DEBUG_TCG instead of NDEBUG, drop now useless code. Cc: Richard Henderson <rth@twiddle.net> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net> Message-id: 1461228530-14852-2-git-send-email-aurelien@aurel32.net Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
Aurelien Jarno authored
The TCG code is quite performance sensitive, but at the same time can also be quite tricky. That is why asserts that can be enabled with the --enable-debug-tcg configure option. This used to work the following way: | #include "config.h" | | ... | | #if !defined(CONFIG_DEBUG_TCG) && !defined(NDEBUG) | /* define it to suppress various consistency checks (faster) */ | #define NDEBUG | #endif | | ... | | #include <assert.h> Since commit 757e725b (tcg: Clean up includes) "config.h" as been replaced by "qemu/osdep.h" which itself includes <assert.h>. As a consequence the assertions are always enabled, even when using --disable-debug-tcg, causing a performance regression, especially on targets with many registers. For instance on qemu-system-ppc the speed difference is about 15%. tcg_debug_assert is controlled directly by CONFIG_DEBUG_TCG and already uses in some places. This patch replaces all the calls to assert into calss to tcg_debug_assert. Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Richard Henderson <rth@twiddle.net> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net> Message-id: 1461228530-14852-1-git-send-email-aurelien@aurel32.net Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Apr 05, 2016
-
-
James Hogan authored
The MIPS TCG backend is the only one to have tcg_target_reg_alloc_order[] elements of type TCGReg rather than int. This resulted in commit 91478cef ("tcg: Allocate indirect_base temporaries in a different order") breaking the build on MIPS since the type differed from indirect_reg_alloc_order[]: tcg/tcg.c:1725:44: error: pointer type mismatch in conditional expression [-Werror] order = rev ? indirect_reg_alloc_order : tcg_target_reg_alloc_order; ^ Make it an array of ints to fix the build and match other architectures. Fixes: 91478cef ("tcg: Allocate indirect_base temporaries in a different order") Signed-off-by:
James Hogan <james.hogan@imgtec.com> Acked-by:
Aurelien Jarno <aurelien@aurel32.net> Message-Id: <1459522179-6584-1-git-send-email-james.hogan@imgtec.com> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
- Mar 22, 2016
-
-
Alex Bennée authored
This ensures the code generation debug code will honour -dfilter if set. For the "exec" tracing I've added a new inline macro for efficiency's sake. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Aurelien Jarno <aurelien@aureL32.net> Reviewed-by:
Richard Henderson <rth@twiddle.net> Message-Id: <1458052224-9316-8-git-send-email-alex.bennee@linaro.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alex Bennée authored
My later debugging patches need access to the origin PC which is held in the TranslationBlock structure. Pass down the whole structure as it also holds the information about the code start point. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Richard Henderson <rth@twiddle.net> Message-Id: <1458052224-9316-3-git-send-email-alex.bennee@linaro.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Veronia Bahaa authored
Move declarations out of qemu-common.h for functions declared in utils/ files: e.g. include/qemu/path.h for utils/path.c. Move inline functions out of qemu-common.h and into new files (e.g. include/qemu/bcd.h) Signed-off-by:
Veronia Bahaa <veroniabahaa@gmail.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Mar 01, 2016
-
-
Lluís Vilanova authored
The target-dependant type TCGv must be defined in "tcg/tcg.h" before including the tracing helper wrappers in "tcg/tcg-op.h". It also makes more sense to define it here, where other TCG types are defined too. Signed-off-by:
Lluís Vilanova <vilanova@ac.upc.edu> Message-id: 145641860129.30295.17554707227384022653.stgit@localhost Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Lluís Vilanova authored
Adds the 'TCGv_env' type for pointers to 'CPUArchState' objects. The tracing infrastructure later needs to differentiate between regular pointers and pointers to vCPUs. Also changes all targets to use the new 'TCGv_env' type instead of the generic 'TCGv_ptr'. As of now, the change is merely cosmetic ('TCGv_env' translates into 'TCGv_ptr'), but that could change in the future to enforce the difference. Note that a 'TCGv_env' type (for 'CPUState') is not added, since all helpers currently receive the architecture-specific pointer ('CPUArchState'). Signed-off-by:
Lluís Vilanova <vilanova@ac.upc.edu> Acked-by:
Richard Henderson <rth@twiddle.net> Message-id: 145641859552.30295.7821536833590725201.stgit@localhost Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Feb 23, 2016
-
-
Peter Maydell authored
Commit 757e725b added a number of #include "qemu/osdep.h" files to the tcg-target.c files (as they were named at the time). These are unnecessary because these files are not standalone C files, and the tcg/tcg.c file which includes them will have already included osdep.h on their behalf. Remove the unneeded include directives. Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <1456238983-10160-4-git-send-email-peter.maydell@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Peter Maydell authored
Rename the per-architecture tcg-target.c files to tcg-target.inc.c. This makes it clearer that they are not intended to be standalone C files, but are instead #included into another source file. Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <1456238983-10160-2-git-send-email-peter.maydell@linaro.org> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Richard Henderson authored
Since we've not got liveness analysis for indirect bases, placing them at the end of the call-saved registers makes it more likely that it'll stay live. Tested-by:
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Richard Henderson authored
That is, global_mem registers whose base is another global_mem register, rather than a fixed register. Tested-by:
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Richard Henderson authored
A previous patch patch changed the type of REG from int to enum TCGReg, which provokes the following bug in clang: https://llvm.org/bugs/show_bug.cgi?id=16154 Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Peter Maydell authored
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
- Feb 08, 2016
-
-
Richard Henderson authored
Unify all of the places that realize a temporary into a register. Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Richard Henderson authored
Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Richard Henderson authored
Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Richard Henderson authored
Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Richard Henderson authored
Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Richard Henderson authored
Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Richard Henderson authored
Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Richard Henderson authored
A subsequent patch patch will change the type of REG from int to enum TCGReg, which provokes the following bug in clang: https://llvm.org/bugs/show_bug.cgi?id=16154 Signed-off-by:
Richard Henderson <rth@twiddle.net>
-
Richard Henderson authored
In particular, make sure the memory is memset before use. Continues the increased use of TCGTemp pointers instead of integer indices where appropriate. Reviewed-by:
Aurelien Jarno <aurelien@aurel32.net> Signed-off-by:
Richard Henderson <rth@twiddle.net>
-