|
|
d1a627 |
From bf18257d85734fc6b116108e7c6511dbd4ad8be8 Mon Sep 17 00:00:00 2001
|
|
|
d1a627 |
From: Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
|
|
|
d1a627 |
Date: Fri, 22 Mar 2013 21:50:17 +0900
|
|
|
d1a627 |
Subject: [PATCH] tcg: Fix occasional TCG broken problem when ldst optimization
|
|
|
d1a627 |
enabled
|
|
|
d1a627 |
|
|
|
d1a627 |
is_tcg_gen_code() checks the upper limit of TCG generated code range wrong, so
|
|
|
d1a627 |
that TCG could get broken occasionally only when CONFIG_QEMU_LDST_OPTIMIZATION
|
|
|
d1a627 |
enabled. The reason is code_gen_buffer_max_size does not cover the upper range
|
|
|
d1a627 |
up to (TCG_MAX_OP_SIZE * OPC_BUF_SIZE), thus code_gen_buffer_max_size should be
|
|
|
d1a627 |
modified to code_gen_buffer_size.
|
|
|
d1a627 |
|
|
|
d1a627 |
CC: qemu-stable@nongnu.org
|
|
|
d1a627 |
Signed-off-by: Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
|
|
|
d1a627 |
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
|
|
|
d1a627 |
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
|
|
|
d1a627 |
(cherry picked from commit 52ae646d4a3ebdcdcc973492c6a56f2c49b6578f)
|
|
|
d1a627 |
|
|
|
d1a627 |
Conflicts:
|
|
|
d1a627 |
translate-all.c
|
|
|
d1a627 |
---
|
|
|
d1a627 |
translate-all.c | 4 ++--
|
|
|
d1a627 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
d1a627 |
|
|
|
d1a627 |
diff --git a/translate-all.c b/translate-all.c
|
|
|
d1a627 |
index d367fc4..bf1db09 100644
|
|
|
d1a627 |
--- a/translate-all.c
|
|
|
d1a627 |
+++ b/translate-all.c
|
|
|
d1a627 |
@@ -1310,10 +1310,10 @@ static void tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
|
|
|
d1a627 |
/* check whether the given addr is in TCG generated code buffer or not */
|
|
|
d1a627 |
bool is_tcg_gen_code(uintptr_t tc_ptr)
|
|
|
d1a627 |
{
|
|
|
d1a627 |
- /* This can be called during code generation, code_gen_buffer_max_size
|
|
|
d1a627 |
+ /* This can be called during code generation, code_gen_buffer_size
|
|
|
d1a627 |
is used instead of code_gen_ptr for upper boundary checking */
|
|
|
d1a627 |
return (tc_ptr >= (uintptr_t)code_gen_buffer &&
|
|
|
d1a627 |
- tc_ptr < (uintptr_t)(code_gen_buffer + code_gen_buffer_max_size));
|
|
|
d1a627 |
+ tc_ptr < (uintptr_t)(code_gen_buffer + code_gen_buffer_size));
|
|
|
d1a627 |
}
|
|
|
d1a627 |
#endif
|
|
|
d1a627 |
|