cpus: Relocate address space initialization

Moves it to qemu_init_vcpu where it belongs
This commit is contained in:
Lioncash 2018-02-18 21:04:59 -05:00
parent 6a7974277a
commit 2210c7f486
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -84,8 +84,17 @@ int qemu_init_vcpu(CPUState *cpu)
cpu->nr_threads = smp_threads;
cpu->stopped = true;
if (tcg_enabled(cpu->uc))
if (!cpu->as) {
/* If the target cpu hasn't set up any address spaces itself,
* give it the default one.
*/
cpu->num_ases = 1;
cpu_address_space_init(cpu, &cpu->uc->as, 0);
}
if (tcg_enabled(cpu->uc)) {
return qemu_tcg_init_vcpu(cpu);
}
return 0;
}
@ -110,14 +119,6 @@ static void *qemu_tcg_cpu_loop(struct uc_struct *uc)
static int qemu_tcg_init_vcpu(CPUState *cpu)
{
if (!cpu->as) {
/* If the target cpu hasn't set up any address spaces itself,
* give it the default one.
*/
cpu->num_ases = 1;
cpu_address_space_init(cpu, &cpu->uc->as, 0);
}
return 0;
}