[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-stable] [PATCH 21/37] tcg: Fix occasional TCG broken problem when

From: Michael Roth
Subject: [Qemu-stable] [PATCH 21/37] tcg: Fix occasional TCG broken problem when ldst optimization enabled
Date: Tue, 2 Apr 2013 16:45:26 -0500

From: Yeongkyoon Lee <address@hidden>

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: address@hidden
Signed-off-by: Yeongkyoon Lee <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
(cherry picked from commit 52ae646d4a3ebdcdcc973492c6a56f2c49b6578f)



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

Signed-off-by: Michael Roth <address@hidden>
 translate-all.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/translate-all.c b/translate-all.c
index d367fc4..bf1db09 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -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));

reply via email to

[Prev in Thread] Current Thread [Next in Thread]