Skip to contentSkip to conversation

target-arm/helper.c: Don't allocate TCG resources unless TCG enabled

PATCH Applied Peter Maydell 2 participants 2 messages Nov 25, 2011 – Dec 5, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-arm/helper.c: Don't allocate TCG resources unless TCG enabled

Don't call arm_translate_init() (which allocates TCG resources) unless TCG is enabled.

---
First KVM related QEMU patch :-)
[without this we segfault on startup if run with -enable-kvm, although the omission is currently harmless for upstream QEMU where TCG is always enabled on ARM.]

 target-arm/helper.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
target-arm/helper.c +1 -1
index 97af4d0..3fe5822 100644
@@ -390,7 +390,7 @@ CPUARMState *cpu_arm_init(const char *cpu_model)
         return NULL;
     env = g_malloc0(sizeof(CPUARMState));
     cpu_exec_init(env);
-    if (!inited) {
+    if (tcg_enabled() && !inited) {
         inited = 1;
         arm_translate_init();
     }
Signature · 1 line
1.7.1
#1 lore raw
Quoted 2 lines · Peter Maydell

Don't call arm_translate_init() (which allocates TCG resources) unless TCG is enabled.

Thanks, applied this patch.

Cheers