mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-24 22:25:11 +00:00
target-i386: Move TCG initialization to realize time
QOM instance_init functions are not supposed to have any side-effects, as new objects may be created at any moment for querying property information (see qmp_device_list_properties()). Move TCG initialization to realize time so it won't be called when just doing object_new() on a X86CPU subclass. Backports commit 57f2453ab48a771b30aeced01b329ee85853bb7b from qemu
This commit is contained in:
parent
fee2c27f2b
commit
9c04a28bd2
|
@ -2785,6 +2785,10 @@ static int x86_cpu_realizefn(struct uc_struct *uc, DeviceState *dev, Error **err
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tcg_enabled(env->uc)) {
|
||||||
|
tcg_x86_init(env->uc);
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
//qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
|
//qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
|
||||||
|
|
||||||
|
@ -2874,11 +2878,6 @@ static void x86_cpu_initfn(struct uc_struct *uc, Object *obj, void *opaque)
|
||||||
cpu->apic_id = -1;
|
cpu->apic_id = -1;
|
||||||
|
|
||||||
x86_cpu_load_def(cpu, xcc->cpu_def, &error_abort);
|
x86_cpu_load_def(cpu, xcc->cpu_def, &error_abort);
|
||||||
|
|
||||||
/* init various static tables used in TCG mode */
|
|
||||||
if (tcg_enabled(env->uc)) {
|
|
||||||
tcg_x86_init(env->uc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t x86_cpu_get_arch_id(CPUState *cs)
|
static int64_t x86_cpu_get_arch_id(CPUState *cs)
|
||||||
|
|
Loading…
Reference in a new issue