summaryrefslogtreecommitdiff
path: root/linux-user/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user/main.c')
-rw-r--r--linux-user/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index 108e1f202c..ba09b7d0c8 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -45,6 +45,7 @@ static const char *argv0;
static int gdbstub_port;
static envlist_t *envlist;
static const char *cpu_model;
+static const char *cpu_type;
unsigned long mmap_min_addr;
unsigned long guest_base;
int have_guest_base;
@@ -4114,7 +4115,7 @@ void init_task_state(TaskState *ts)
CPUArchState *cpu_copy(CPUArchState *env)
{
CPUState *cpu = ENV_GET_CPU(env);
- CPUState *new_cpu = cpu_init(cpu_model);
+ CPUState *new_cpu = cpu_create(cpu_type);
CPUArchState *new_env = new_cpu->env_ptr;
CPUBreakpoint *bp;
CPUWatchpoint *wp;
@@ -4597,10 +4598,13 @@ int main(int argc, char **argv, char **envp)
if (cpu_model == NULL) {
cpu_model = cpu_get_model(get_elf_eflags(execfd));
}
+ cpu_type = parse_cpu_model(cpu_model);
+
tcg_exec_init(0);
/* NOTE: we need to init the CPU at this stage to get
qemu_host_page_size */
- cpu = cpu_init(cpu_model);
+
+ cpu = cpu_create(cpu_type);
env = cpu->env_ptr;
cpu_reset(cpu);