[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 3/5] linux-user: Use lookup_cpu_class()
From: |
Eduardo Habkost |
Subject: |
[Qemu-ppc] [PATCH 3/5] linux-user: Use lookup_cpu_class() |
Date: |
Tue, 16 Apr 2019 23:59:42 -0300 |
The return value of cpu_get_model() is just a CPU model name and
never includes extra options. We don't need to call
parse_cpu_option().
Signed-off-by: Eduardo Habkost <address@hidden>
---
linux-user/main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index 20e0f51cfa..d74108e05c 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -592,6 +592,7 @@ int main(int argc, char **argv, char **envp)
TaskState *ts;
CPUArchState *env;
CPUState *cpu;
+ CPUClass *cc;
int optind;
char **target_environ, **wrk;
char **target_argv;
@@ -660,7 +661,8 @@ 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_option(cpu_model);
+ cc = lookup_cpu_class(cpu_model, &error_fatal);
+ cpu_type = object_class_get_name(OBJECT_CLASS(cc));
/* init tcg before creating CPUs and to get qemu_host_page_size */
tcg_exec_init(0);
--
2.18.0.rc1.1.g3f1ff2140
- [Qemu-ppc] [PATCH 0/5] Remove qdev_get_machine() call from ppc_cpu_parse_featurestr(), Eduardo Habkost, 2019/04/16
- [Qemu-ppc] [PATCH 1/5] cpu: Rename parse_cpu_model() to parse_cpu_option(), Eduardo Habkost, 2019/04/16
- [Qemu-ppc] [PATCH 2/5] cpu: Extract CPU class lookup from parse_cpu_option(), Eduardo Habkost, 2019/04/16
- [Qemu-ppc] [PATCH 4/5] bsd-user: Use lookup_cpu_class(), Eduardo Habkost, 2019/04/16
- [Qemu-ppc] [PATCH 3/5] linux-user: Use lookup_cpu_class(),
Eduardo Habkost <=
- [Qemu-ppc] [PATCH 5/5] cpu: Add MachineState parameter to parse_features(), Eduardo Habkost, 2019/04/16
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 0/5] Remove qdev_get_machine() call from ppc_cpu_parse_featurestr(), Markus Armbruster, 2019/04/17