]> git.proxmox.com Git - qemu.git/blobdiff - target-s390x/cpu.c
target-s390x: Move TCG initialization to S390CPU initfn
[qemu.git] / target-s390x / cpu.c
index ee15783b94886331257a6080f120b3d858d0999e..787c937579593253b278c05d5eaab13d2fd0fcd8 100644 (file)
@@ -112,6 +112,7 @@ static void s390_cpu_initfn(Object *obj)
 {
     S390CPU *cpu = S390_CPU(obj);
     CPUS390XState *env = &cpu->env;
+    static bool inited;
     static int cpu_num = 0;
 #if !defined(CONFIG_USER_ONLY)
     struct tm tm;
@@ -133,6 +134,11 @@ static void s390_cpu_initfn(Object *obj)
 #endif
     env->cpu_num = cpu_num++;
     env->ext_index = -1;
+
+    if (tcg_enabled() && !inited) {
+        inited = true;
+        s390x_translate_init();
+    }
 }
 
 static void s390_cpu_finalize(Object *obj)