[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 15/23] ppc: spapr: register 'host' core type along wit
From: |
Igor Mammedov |
Subject: |
[Qemu-ppc] [PATCH 15/23] ppc: spapr: register 'host' core type along with the rest of core types |
Date: |
Thu, 5 Oct 2017 18:24:42 +0200 |
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 <address@hidden>
---
include/hw/ppc/spapr_cpu_core.h | 1 -
hw/ppc/spapr_cpu_core.c | 5 ++++-
target/ppc/kvm.c | 11 -----------
3 files changed, 4 insertions(+), 13 deletions(-)
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/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 8e13e52..f2da4be 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -220,7 +220,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);
@@ -257,6 +257,9 @@ static const TypeInfo spapr_cpu_core_type_infos[] = {
DEFINE_SPAPR_CPU_CORE_TYPE("power8e_v2.1"),
DEFINE_SPAPR_CPU_CORE_TYPE("power8nvl_v1.0"),
DEFINE_SPAPR_CPU_CORE_TYPE("power9_v1.0"),
+#ifdef CONFIG_KVM
+ DEFINE_SPAPR_CPU_CORE_TYPE("host"),
+#endif
};
DEFINE_TYPES(spapr_cpu_core_type_infos)
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
--
2.7.4
- [Qemu-ppc] [PATCH 07/23] ppc: bamboo: use generic cpu_model parsing, (continued)
- [Qemu-ppc] [PATCH 07/23] ppc: bamboo: use generic cpu_model parsing, Igor Mammedov, 2017/10/05
- [Qemu-ppc] [PATCH 08/23] ppc: replace cpu_model with cpu_type on ref405ep, taihu boards, Igor Mammedov, 2017/10/05
- [Qemu-ppc] [PATCH 11/23] ppc: spapr: replace ppc_cpu_parse_features() with cpu_parse_cpu_model(), Igor Mammedov, 2017/10/05
- [Qemu-ppc] [PATCH 14/23] ppc: spapr: use cpu type name directly, Igor Mammedov, 2017/10/05
- [Qemu-ppc] [PATCH 15/23] ppc: spapr: register 'host' core type along with the rest of core types,
Igor Mammedov <=
- [Qemu-ppc] [PATCH 13/23] ppc: spapr: define core types statically, Igor Mammedov, 2017/10/05
- [Qemu-ppc] [PATCH 12/23] ppc: move '-cpu foo, compat=xxx' parsing into ppc_cpu_parse_featurestr(), Igor Mammedov, 2017/10/05