[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-next 05/12] pc: Add CPU as /machine/cpu[n]
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH qom-next 05/12] pc: Add CPU as /machine/cpu[n] |
Date: |
Wed, 30 May 2012 00:10:18 +0200 |
From: Andreas Färber <address@hidden>
Using the cpu_index, give the X86CPU a canonical path.
This must be done before initializing the APIC.
Signed-off-by: Igor Mammedov <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
hw/pc.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index 4167782..e9d7e05 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -945,6 +945,8 @@ static X86CPU *pc_new_cpu(const char *cpu_model)
{
X86CPU *cpu;
CPUX86State *env;
+ char *name;
+ Error *error = NULL;
cpu = cpu_x86_init(cpu_model);
if (cpu == NULL) {
@@ -952,6 +954,16 @@ static X86CPU *pc_new_cpu(const char *cpu_model)
exit(1);
}
env = &cpu->env;
+
+ name = g_strdup_printf("cpu[%d]", env->cpu_index);
+ object_property_add_child(OBJECT(qdev_get_machine()), name,
+ OBJECT(cpu), &error);
+ g_free(name);
+ if (error_is_set(&error)) {
+ qerror_report_err(error);
+ exit(1);
+ }
+
if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) {
env->apic_state = apic_init(env, env->cpuid_apic_id);
}
--
1.7.7.6
- Re: [Qemu-devel] [PATCH qom-next 01/12] store prev_debug_excp_handler globaly and not per target, (continued)
[Qemu-devel] [PATCH qom-next 02/12] target-xtensa: use global prev_debug_excp_handler instead of local one, Igor Mammedov, 2012/05/29
[Qemu-devel] [PATCH qom-next 03/12] target-i386: use global prev_debug_excp_handler instead of local one, Igor Mammedov, 2012/05/29
[Qemu-devel] [PATCH qom-next 04/12] target-i386: move tcg initialization into x86_cpu_initfn(), Igor Mammedov, 2012/05/29
[Qemu-devel] [PATCH qom-next 05/12] pc: Add CPU as /machine/cpu[n],
Igor Mammedov <=
[Qemu-devel] [PATCH qom-next 06/12] apic: Replace cpu_env pointer by X86CPU link, Igor Mammedov, 2012/05/29
[Qemu-devel] [PATCH qom-next 07/12] target-i386: move cpu halted decision into x86_cpu_reset, Igor Mammedov, 2012/05/29
[Qemu-devel] [PATCH qom-next 09/12] target-i386: make cpu a child of /machine right after it's created, Igor Mammedov, 2012/05/29
[Qemu-devel] [PATCH qom-next 12/12] target-i386: move reset callback to cpu.c and call cpu_reset() in x86_cpu_realize(), Igor Mammedov, 2012/05/29
[Qemu-devel] [PATCH qom-next 08/12] target-i386: introduce cpu-model property for x86_cpu, Igor Mammedov, 2012/05/29