[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/21] target-i386: cpu: attach ICC bus to CPU on it
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 13/21] target-i386: cpu: attach ICC bus to CPU on its creation |
Date: |
Tue, 23 Apr 2013 10:29:47 +0200 |
X86CPU should have parent bus so it would be possible to unplug
it later. Set bus_type to TYPE_ICC_BUS for X86CPU type to make
device_add attach hotplugged CPU to ICC bus.
Signed-off-by: Igor Mammedov <address@hidden>
---
v2:
* make sure that missing or ambiguous icc-bus will cause error
on softmmu target.
---
target-i386/cpu.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 296ba58..8d3ad00 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -41,6 +41,7 @@
#endif
#include "sysemu/sysemu.h"
+#include "hw/cpu/icc_bus.h"
#ifndef CONFIG_USER_ONLY
#include "hw/xen/xen.h"
#include "hw/sysbus.h"
@@ -1619,6 +1620,19 @@ X86CPU *cpu_x86_create(const char *cpu_model, Error
**errp)
features = model_pieces[1];
cpu = X86_CPU(object_new(TYPE_X86_CPU));
+#ifndef CONFIG_USER_ONLY
+ do {
+ bool ambiguous = false;
+ Object *icc_bus = object_resolve_path_type("icc-bus", TYPE_ICC_BUS,
+ &ambiguous);
+ if ((icc_bus == NULL) || ambiguous) {
+ error_setg(&error, "Invalid icc-bus value");
+ goto out;
+ }
+ qdev_set_parent_bus(DEVICE(cpu), BUS(icc_bus));
+ object_unref(OBJECT(cpu));
+ } while (0);
+#endif
env = &cpu->env;
env->cpu_model_str = cpu_model;
@@ -2330,6 +2344,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc,
void *data)
xcc->parent_realize = dc->realize;
dc->realize = x86_cpu_realizefn;
+ dc->bus_type = TYPE_ICC_BUS;
xcc->parent_reset = cc->reset;
cc->reset = x86_cpu_reset;
--
1.7.1
- Re: [Qemu-devel] [PATCH 02/21] cpu: call cpu_synchronize_post_init() from CPUClass.realize() if hotplugged, (continued)
[Qemu-devel] [PATCH 07/21] cpu: introduce get_arch_id() method and override it for target-i386, Igor Mammedov, 2013/04/23
[Qemu-devel] [PATCH 03/21] introduce cpu_resume(), for single CPU, Igor Mammedov, 2013/04/23
[Qemu-devel] [PATCH 09/21] cpu: add helper cpu_exists(), to check if CPU with specified id exists, Igor Mammedov, 2013/04/23
[Qemu-devel] [PATCH 12/21] target-i386: introduce ICC bus/device/bridge, Igor Mammedov, 2013/04/23
[Qemu-devel] [PATCH 08/21] exec: add qemu_for_each_cpu, Igor Mammedov, 2013/04/23
[Qemu-devel] [PATCH 13/21] target-i386: cpu: attach ICC bus to CPU on its creation,
Igor Mammedov <=
[Qemu-devel] [PATCH 11/21] target-i386: introduce apic-id property, Igor Mammedov, 2013/04/23
[Qemu-devel] [PATCH 10/21] acpi_piix4: add infrastructure to send CPU hot-plug GPE to guest, Igor Mammedov, 2013/04/23
Re: [Qemu-devel] [PATCH 10/21] acpi_piix4: add infrastructure to send CPU hot-plug GPE to guest, Juan Quintela, 2013/04/23
Re: [Qemu-devel] [PATCH 10/21] acpi_piix4: add infrastructure to send CPU hot-plug GPE to guest, Juan Quintela, 2013/04/23
Re: [Qemu-devel] [PATCH 10/21] acpi_piix4: add infrastructure to send CPU hot-plug GPE to guest, Igor Mammedov, 2013/04/23