summaryrefslogtreecommitdiffstats
path: root/exec.c
diff options
context:
space:
mode:
authorYeongkyoon Lee <yeongkyoon.lee@samsung.com>2012-10-31 16:04:24 +0900
committerBlue Swirl <blauwirbel@gmail.com>2012-11-03 09:44:20 +0000
commitfdbb84d1332ae0827d60f1a2ca03c7d5678c6edd (patch)
tree1f05b7cd3c113d4cd2bba0b35964b3af8a586c6c /exec.c
parent32761257c0b9fa7ee04d2871a6e48a41f119c469 (diff)
downloadhqemu-fdbb84d1332ae0827d60f1a2ca03c7d5678c6edd.zip
hqemu-fdbb84d1332ae0827d60f1a2ca03c7d5678c6edd.tar.gz
tcg: Add extended GETPC mechanism for MMU helpers with ldst optimization
Add GETPC_EXT which is used by MMU helpers to selectively calculate the code address of accessing guest memory when called from a qemu_ld/st optimized code or a C function. Currently, it supports only i386 and x86-64 hosts. Signed-off-by: Yeongkyoon Lee <yeongkyoon.lee@samsung.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index df67938..8bff743 100644
--- a/exec.c
+++ b/exec.c
@@ -1390,6 +1390,17 @@ void tb_link_page(TranslationBlock *tb,
mmap_unlock();
}
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU)
+/* 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
+ 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));
+}
+#endif
+
/* find the TB 'tb' such that tb[0].tc_ptr <= tc_ptr <
tb[1].tc_ptr. Return NULL if not found */
TranslationBlock *tb_find_pc(uintptr_t tc_ptr)
OpenPOWER on IntegriCloud