[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/15] target-i386: cpu: attach ICC bus to CPU on it
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 06/15] target-i386: cpu: attach ICC bus to CPU on its creation |
Date: |
Thu, 25 Apr 2013 16:05:28 +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 b0eb6ca..25eb158 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
- [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized, (continued)
- [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized, Igor Mammedov, 2013/04/26
- Re: [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized, Andreas Färber, 2013/04/26
- Re: [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized, Igor Mammedov, 2013/04/26
- [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id once CPU is realized, Igor Mammedov, 2013/04/26
- Re: [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id once CPU is realized, Andreas Färber, 2013/04/27
- Re: [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized, Eduardo Habkost, 2013/04/26
[Qemu-devel] [PATCH 02/15] cpu: add helper cpu_exists(), to check if CPU with specified id exists, Igor Mammedov, 2013/04/25
[Qemu-devel] [PATCH 05/15] target-i386: introduce ICC bus/device/bridge, Igor Mammedov, 2013/04/25
[Qemu-devel] [PATCH 06/15] target-i386: cpu: attach ICC bus to CPU on its creation,
Igor Mammedov <=
[Qemu-devel] [PATCH 07/15] target-i386: replace MSI_SPACE_SIZE with APIC_SPACE_SIZE, Igor Mammedov, 2013/04/25
[Qemu-devel] [PATCH 08/15] target-i386: kvmvapic: make expilict dependency on sysbus.h, Igor Mammedov, 2013/04/25
[Qemu-devel] [PATCH 09/15] target-i386: move APIC to ICC bus, Igor Mammedov, 2013/04/25
[Qemu-devel] [PATCH 10/15] extend memory_region_find() and use it in kvm/ioapic, Igor Mammedov, 2013/04/25
[Qemu-devel] [PATCH 13/15] add hot_add_cpu hook to QEMUMachine and export machine_args, Igor Mammedov, 2013/04/25
[Qemu-devel] [PATCH 12/15] pc: pass QEMUMachineInitArgs down to pc_cpus_init(), Igor Mammedov, 2013/04/25
[Qemu-devel] [PATCH 11/15] target-i386: move IOAPIC to ICC bus, Igor Mammedov, 2013/04/25
[Qemu-devel] [PATCH 14/15] target-i386: implement machine->hot_add_cpu hook, Igor Mammedov, 2013/04/25