[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/22] target-i386: cpu: attach ICC bus to CPU on it
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 16/22] target-i386: cpu: attach ICC bus to CPU on its creation |
Date: |
Fri, 5 Apr 2013 16:37:08 +0200 |
... during startup, so it would be possible to uplug it later
and 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>
---
target-i386/cpu.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index db56b52..2b3c1f3 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -41,6 +41,7 @@
#endif
#include "sysemu/sysemu.h"
+#include "hw/icc_bus.h"
#ifndef CONFIG_USER_ONLY
#include "hw/xen.h"
#include "hw/sysbus.h"
@@ -1604,6 +1605,7 @@ X86CPU *cpu_x86_create(const char *cpu_model, Error
**errp)
CPUX86State *env;
gchar **model_pieces;
char *name, *features;
+ Object *icc_bus = object_resolve_path_type("icc-bus", TYPE_ICC_BUS, NULL);
model_pieces = g_strsplit(cpu_model, ",", 2);
if (!model_pieces[0]) {
@@ -1614,6 +1616,10 @@ X86CPU *cpu_x86_create(const char *cpu_model, Error
**errp)
features = model_pieces[1];
cpu = X86_CPU(object_new(TYPE_X86_CPU));
+ if (icc_bus) {
+ qdev_set_parent_bus(DEVICE(cpu), BUS(icc_bus));
+ object_unref(OBJECT(cpu));
+ }
env = &cpu->env;
env->cpu_model_str = cpu_model;
@@ -2323,6 +2329,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.8.1.4
- Re: [Qemu-devel] [PATCH 06/22] cpu: introduce CPUClass.resume() method, (continued)
- [Qemu-devel] [PATCH 13/22] acpi_piix4: add infrastructure to send CPU hot-plug GPE to guest, Igor Mammedov, 2013/04/05
- [Qemu-devel] [PATCH 10/22] rtc: update rtc_cmos on CPU hot-plug, Igor Mammedov, 2013/04/05
- [Qemu-devel] [PATCH 11/22] cpu: introduce get_firmware_id() method and override it for target-i386, Igor Mammedov, 2013/04/05
- [Qemu-devel] [PATCH 17/22] target-i386: replace MSI_SPACE_SIZE with APIC_SPACE_SIZE, Igor Mammedov, 2013/04/05
- [Qemu-devel] [PATCH 16/22] target-i386: cpu: attach ICC bus to CPU on its creation,
Igor Mammedov <=
- [Qemu-devel] [PATCH 18/22] target-i386: move APIC to ICC bus, Igor Mammedov, 2013/04/05
- [Qemu-devel] [PATCH 14/22] target-i386: introduce apic-id property, Igor Mammedov, 2013/04/05
- [Qemu-devel] [PATCH 09/22] introduce CPU hot-plug notifier, Igor Mammedov, 2013/04/05
- [Qemu-devel] [PATCH 21/22] target-i386: expose all possible CPUs as /machine/icc-bridge/cpu[0..N] links, Igor Mammedov, 2013/04/05