diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2011-08-02 16:10:21 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-05 10:57:36 -0500 |
commit | d5ab9713d2d4037fd56b0adddd26c8d4dc11cf09 (patch) | |
tree | ba4403df5a9b47e6ff26bce8db41864ca665c5ce /exec.c | |
parent | 8417cebfda193c7f9ca70be5e308eaa92cf84b94 (diff) |
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.c | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -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) |