]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
mips: call cpu_mips_realize_env() from mips_cpu_realizefn()
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Wed, 20 Sep 2017 19:49:32 +0000 (16:49 -0300)
committerYongbok Kim <yongbok.kim@imgtec.com>
Thu, 21 Sep 2017 12:25:27 +0000 (13:25 +0100)
This changes the order between cpu_mips_realize_env() and
cpu_exec_initfn(), but cpu_exec_initfn() don't have anything that
depends on cpu_mips_realize_env() being called first.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Igor Mammedov <imammedo@redhat.com>
Tested-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
target/mips/cpu.c
target/mips/translate.c

index 68bf423e9daa5cc1ede3848ce6425f2a5100e3d9..e3ef8355990a096d4fdbde043395aff377af6c5c 100644 (file)
@@ -123,6 +123,7 @@ static void mips_cpu_disas_set_info(CPUState *s, disassemble_info *info) {
 static void mips_cpu_realizefn(DeviceState *dev, Error **errp)
 {
     CPUState *cs = CPU(dev);
+    MIPSCPU *cpu = MIPS_CPU(dev);
     MIPSCPUClass *mcc = MIPS_CPU_GET_CLASS(dev);
     Error *local_err = NULL;
 
@@ -132,6 +133,8 @@ static void mips_cpu_realizefn(DeviceState *dev, Error **errp)
         return;
     }
 
+    cpu_mips_realize_env(&cpu->env);
+
     cpu_reset(cs);
     qemu_init_vcpu(cs);
 
index 5fc7979ac5e8d2b3f444d5d01201bd0d5e6ca2b2..94c38e8755e47a2575f7d4a4a4b47760137fb9e5 100644 (file)
@@ -20535,7 +20535,6 @@ MIPSCPU *cpu_mips_init(const char *cpu_model)
     cpu = MIPS_CPU(object_new(TYPE_MIPS_CPU));
     env = &cpu->env;
     env->cpu_model = def;
-    cpu_mips_realize_env(env);
 
     object_property_set_bool(OBJECT(cpu), true, "realized", NULL);