Skip to content

Commit

Permalink
tcg: Fix occasional TCG broken problem when ldst optimization enabled
Browse files Browse the repository at this point in the history
is_tcg_gen_code() checks the upper limit of TCG generated code range wrong, so
that TCG could get broken occasionally only when CONFIG_QEMU_LDST_OPTIMIZATION
enabled. The reason is code_gen_buffer_max_size does not cover the upper range
up to (TCG_MAX_OP_SIZE * OPC_BUF_SIZE), thus code_gen_buffer_max_size should be
modified to code_gen_buffer_size.

CC: qemu-stable@nongnu.org
Signed-off-by: Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 52ae646)

Conflicts:

	translate-all.c

*modified to use non-tcg-ctx version of code_gen_* variables

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
Yeongkyoon Lee authored and mdroth committed Apr 2, 2013
1 parent d26efd2 commit b0da310
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions translate-all.c
Expand Up @@ -1310,10 +1310,10 @@ static void tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
/* check whether the given addr is in TCG generated code buffer or not */
bool is_tcg_gen_code(uintptr_t tc_ptr)
{
/* This can be called during code generation, code_gen_buffer_max_size
/* This can be called during code generation, code_gen_buffer_size
is used instead of code_gen_ptr for upper boundary checking */
return (tc_ptr >= (uintptr_t)code_gen_buffer &&
tc_ptr < (uintptr_t)(code_gen_buffer + code_gen_buffer_max_size));
tc_ptr < (uintptr_t)(code_gen_buffer + code_gen_buffer_size));
}
#endif

Expand Down

0 comments on commit b0da310

Please sign in to comment.