aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-08-02 16:10:21 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-05 10:57:36 -0500
commitd5ab9713d2d4037fd56b0adddd26c8d4dc11cf09 (patch)
treeba4403df5a9b47e6ff26bce8db41864ca665c5ce /exec.c
parent8417cebfda193c7f9ca70be5e308eaa92cf84b94 (diff)
downloadqemu-d5ab9713d2d4037fd56b0adddd26c8d4dc11cf09.zip
qemu-d5ab9713d2d4037fd56b0adddd26c8d4dc11cf09.tar.gz
qemu-d5ab9713d2d4037fd56b0adddd26c8d4dc11cf09.tar.bz2
Avoid allocating TCG resources in non-TCG mode
Do not allocate TCG-only resources like the translation buffer when running over KVM or XEN. Saves a "few" bytes in the qemu address space and is also conceptually cleaner. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/exec.c b/exec.c
index 751fd89..5bc9203 100644
--- a/exec.c
+++ b/exec.c
@@ -570,16 +570,12 @@ static void code_gen_alloc(unsigned long tb_size)
/* Must be called before using the QEMU cpus. 'tb_size' is the size
(in bytes) allocated to the translation buffer. Zero means default
size. */
-void cpu_exec_init_all(unsigned long tb_size)
+void tcg_exec_init(unsigned long tb_size)
{
cpu_gen_init();
code_gen_alloc(tb_size);
code_gen_ptr = code_gen_buffer;
page_init();
-#if !defined(CONFIG_USER_ONLY)
- memory_map_init();
- io_mem_init();
-#endif
#if !defined(CONFIG_USER_ONLY) || !defined(CONFIG_USE_GUEST_BASE)
/* There's no guest base to take into account, so go ahead and
initialize the prologue now. */
@@ -587,6 +583,19 @@ void cpu_exec_init_all(unsigned long tb_size)
#endif
}
+bool tcg_enabled(void)
+{
+ return code_gen_buffer != NULL;
+}
+
+void cpu_exec_init_all(void)
+{
+#if !defined(CONFIG_USER_ONLY)
+ memory_map_init();
+ io_mem_init();
+#endif
+}
+
#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
static int cpu_common_post_load(void *opaque, int version_id)