[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 18/34] ppc: spapr: replace ppc_cpu_parse_features() wit
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 18/34] ppc: spapr: replace ppc_cpu_parse_features() with cpu_parse_cpu_model() |
Date: |
Tue, 17 Oct 2017 15:21:36 +1100 |
From: Igor Mammedov <address@hidden>
ppc_cpu_parse_features() is doing practically the same thing as
generic cpu_parse_cpu_model(). So remove duplicated impl. and
reuse generic one.
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Acked-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/ppc.c | 25 -------------------------
hw/ppc/spapr_cpu_core.c | 9 ++++-----
include/hw/ppc/ppc.h | 2 --
3 files changed, 4 insertions(+), 32 deletions(-)
diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index 05da316e0b..7ec35de5ae 100644
--- a/hw/ppc/ppc.c
+++ b/hw/ppc/ppc.c
@@ -1359,28 +1359,3 @@ void PPC_debug_write (void *opaque, uint32_t addr,
uint32_t val)
break;
}
}
-
-void ppc_cpu_parse_features(const char *cpu_model)
-{
- CPUClass *cc;
- ObjectClass *oc;
- const char *typename;
- gchar **model_pieces;
-
- model_pieces = g_strsplit(cpu_model, ",", 2);
- if (!model_pieces[0]) {
- error_report("Invalid/empty CPU model name");
- exit(1);
- }
-
- oc = cpu_class_by_name(TYPE_POWERPC_CPU, model_pieces[0]);
- if (oc == NULL) {
- error_report("Unable to find CPU definition: %s", model_pieces[0]);
- exit(1);
- }
-
- typename = object_class_get_name(oc);
- cc = CPU_CLASS(oc);
- cc->parse_features(typename, model_pieces[1], &error_fatal);
- g_strfreev(model_pieces);
-}
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 37beb56e8b..79a9615080 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -34,6 +34,7 @@ void spapr_cpu_parse_features(sPAPRMachineState *spapr)
* before passing it on to the cpu level parser.
*/
gchar **inpieces;
+ gchar *newprops;
int i, j;
gchar *compat_str = NULL;
@@ -58,17 +59,15 @@ void spapr_cpu_parse_features(sPAPRMachineState *spapr)
if (compat_str) {
char *val = compat_str + strlen("compat=");
- gchar *newprops = g_strjoinv(",", inpieces);
object_property_set_str(OBJECT(spapr), val, "max-cpu-compat",
&error_fatal);
- ppc_cpu_parse_features(newprops);
- g_free(newprops);
- } else {
- ppc_cpu_parse_features(MACHINE(spapr)->cpu_model);
}
+ newprops = g_strjoinv(",", inpieces);
+ cpu_parse_cpu_model(TYPE_POWERPC_CPU, newprops);
+ g_free(newprops);
g_strfreev(inpieces);
}
diff --git a/include/hw/ppc/ppc.h b/include/hw/ppc/ppc.h
index 4e7fe110d6..ff0ac306be 100644
--- a/include/hw/ppc/ppc.h
+++ b/include/hw/ppc/ppc.h
@@ -105,6 +105,4 @@ enum {
/* ppc_booke.c */
void ppc_booke_timers_init(PowerPCCPU *cpu, uint32_t freq, uint32_t flags);
-
-void ppc_cpu_parse_features(const char *cpu_model);
#endif
--
2.13.6
- [Qemu-ppc] [PULL 03/34] target/ppc: Remove unused PPC 460 and 460F definitions, (continued)
- [Qemu-ppc] [PULL 03/34] target/ppc: Remove unused PPC 460 and 460F definitions, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 04/34] spapr: fix OF word name in comment, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 05/34] spapr: sanity check size of the CAS buffer, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 06/34] target/ppc: Add POWER9 DD2.0 model information, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 10/34] qom: add helper macro DEFINE_TYPES(), David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 13/34] ppc: mac_oldworld: use generic cpu_model parsing, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 09/34] qom: introduce type_register_static_array(), David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 22/34] ppc: spapr: register 'host' core type along with the rest of core types, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 12/34] ppc: mac_newworld: use generic cpu_model parsing, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 16/34] ppc: virtex-ml507: replace cpu_model with cpu_type, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 18/34] ppc: spapr: replace ppc_cpu_parse_features() with cpu_parse_cpu_model(),
David Gibson <=
- [Qemu-ppc] [PULL 08/34] hw/ppc/spapr.c: abort unplug_request if previous unplug isn't done, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 19/34] ppc: move '-cpu foo, compat=xxx' parsing into ppc_cpu_parse_featurestr(), David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 33/34] spapr_pci: fail gracefully with non-pseries machine types, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 14/34] ppc: bamboo: use generic cpu_model parsing, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 31/34] ppc: pnv: consolidate type definitions and batch register them, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 07/34] target/ppc: Fix carry flag setting for shift algebraic instructions, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 15/34] ppc: replace cpu_model with cpu_type on ref405ep, taihu boards, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 11/34] ppc: mpc8544ds/e500plat: use generic cpu_model parsing, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 24/34] ppc: move ppc_cpu_lookup_alias() before its first user, David Gibson, 2017/10/17
- [Qemu-ppc] [PULL 23/34] ppc: spapr: use cpu model names as tcg defaults instead of aliases, David Gibson, 2017/10/17