aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2017-10-09 21:51:02 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2017-10-17 10:34:00 +1100
commit5bbb2641861934e1ba52151cb9eb4cfac581346c (patch)
tree8fb61d9b8f6277328f4f037d90151f99bc9fee42
parentb51d3c8818e2fd0a4a36a43d7f8756274cbc5ac9 (diff)
downloadqemu-5bbb2641861934e1ba52151cb9eb4cfac581346c.zip
qemu-5bbb2641861934e1ba52151cb9eb4cfac581346c.tar.gz
qemu-5bbb2641861934e1ba52151cb9eb4cfac581346c.tar.bz2
ppc: spapr: register 'host' core type along with the rest of core types
consolidate 'host' core type registration by moving it from KVM specific code into spapr_cpu_core.c, similar like it's done in x86 target. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--hw/ppc/spapr_cpu_core.c5
-rw-r--r--include/hw/ppc/spapr_cpu_core.h1
-rw-r--r--target/ppc/kvm.c11
3 files changed, 4 insertions, 13 deletions
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 9810697..7dbf9c3 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -221,7 +221,7 @@ static Property spapr_cpu_core_properties[] = {
DEFINE_PROP_END_OF_LIST()
};
-void spapr_cpu_core_class_init(ObjectClass *oc, void *data)
+static void spapr_cpu_core_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
sPAPRCPUCoreClass *scc = SPAPR_CPU_CORE_CLASS(oc);
@@ -259,6 +259,9 @@ static const TypeInfo spapr_cpu_core_type_infos[] = {
DEFINE_SPAPR_CPU_CORE_TYPE("power8nvl_v1.0"),
DEFINE_SPAPR_CPU_CORE_TYPE("power9_v1.0"),
DEFINE_SPAPR_CPU_CORE_TYPE("power9_v2.0"),
+#ifdef CONFIG_KVM
+ DEFINE_SPAPR_CPU_CORE_TYPE("host"),
+#endif
};
DEFINE_TYPES(spapr_cpu_core_type_infos)
diff --git a/include/hw/ppc/spapr_cpu_core.h b/include/hw/ppc/spapr_cpu_core.h
index 264ce68..42765de 100644
--- a/include/hw/ppc/spapr_cpu_core.h
+++ b/include/hw/ppc/spapr_cpu_core.h
@@ -38,5 +38,4 @@ typedef struct sPAPRCPUCoreClass {
} sPAPRCPUCoreClass;
char *spapr_get_cpu_core_type(const char *model);
-void spapr_cpu_core_class_init(ObjectClass *oc, void *data);
#endif
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index c2152ed..cb5777a 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -2508,17 +2508,6 @@ static int kvm_ppc_register_host_cpu_type(void)
oc = object_class_by_name(type_info.name);
g_assert(oc);
-#if defined(TARGET_PPC64)
- type_info.name = g_strdup_printf("%s-"TYPE_SPAPR_CPU_CORE, "host");
- type_info.parent = TYPE_SPAPR_CPU_CORE,
- type_info.instance_size = sizeof(sPAPRCPUCore);
- type_info.instance_init = NULL;
- type_info.class_init = spapr_cpu_core_class_init;
- type_info.class_data = (void *) POWERPC_CPU_TYPE_NAME("host");
- type_register(&type_info);
- g_free((void *)type_info.name);
-#endif
-
/*
* Update generic CPU family class alias (e.g. on a POWER8NVL host,
* we want "POWER8" to be a "family" alias that points to the current