From: Yeongkyoon Lee Date: Sat, 23 Mar 2013 09:52:18 +0000 (+0900) Subject: tcg: Fix occasional TCG broken problem when ldst optimization enabled X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1035 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f7b6cbccd812fd12bcddc851a3e949d2f1e3af3;p=sdk%2Femulator%2Fqemu.git tcg: Fix occasional TCG broken problem when ldst optimization enabled 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. This patch has been already applied to mainstream QEMU. So it should be overwritten when applying QEMU version more than 1.3 in future. Signed-off-by: Yeongkyoon Lee --- diff --git a/exec.c b/exec.c index a64e70bda0..8e6bf12671 100644 --- a/exec.c +++ b/exec.c @@ -1386,10 +1386,10 @@ void tb_link_page(TranslationBlock *tb, /* 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