[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/5] apic: create apic as a child of cpu, not sy
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 5/5] apic: create apic as a child of cpu, not system_bus any longer |
Date: |
Tue, 10 Jul 2012 10:45:20 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Il 10/07/2012 08:16, Liu Ping Fan ha scritto:
> Signed-off-by: Liu Ping Fan <address@hidden>
> ---
> hw/pc.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/hw/pc.c b/hw/pc.c
> index c7e9ab3..8df58c9 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -886,17 +886,17 @@ DeviceState *cpu_get_current_apic(void)
> }
> }
>
> -static DeviceState *apic_init(void *env, uint8_t apic_id)
> +static DeviceState *apic_init(void *cpu, void *env, uint8_t apic_id)
> {
> DeviceState *dev;
> static int apic_mapped;
>
> if (kvm_irqchip_in_kernel()) {
> - dev = qdev_create(NULL, "kvm-apic");
> + dev = qdev_create_kid(OBJECT(cpu), "kvm-apic");
> } else if (xen_enabled()) {
> - dev = qdev_create(NULL, "xen-apic");
> + dev = qdev_create_kid(OBJECT(cpu), "xen-apic");
> } else {
> - dev = qdev_create(NULL, "apic");
> + dev = qdev_create_kid(OBJECT(cpu), "apic");
> }
Does it make sense instead to do this in the realize method of the CPU?
Paolo
>
> qdev_prop_set_uint8(dev, "id", apic_id);
> @@ -945,7 +945,7 @@ static X86CPU *pc_new_cpu(const char *cpu_model)
> }
> env = &cpu->env;
> if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) {
> - env->apic_state = apic_init(env, env->cpuid_apic_id);
> + env->apic_state = apic_init(cpu, env, env->cpuid_apic_id);
> }
> qemu_register_reset(pc_cpu_reset, cpu);
> pc_cpu_reset(cpu);
>
- Re: [Qemu-devel] [PATCH 2/5] qom: introduce object_is_type_str(), so we can judge its type., (continued)
[Qemu-devel] [PATCH 5/5] apic: create apic as a child of cpu, not system_bus any longer, Liu Ping Fan, 2012/07/10
- Re: [Qemu-devel] [PATCH 5/5] apic: create apic as a child of cpu, not system_bus any longer,
Paolo Bonzini <=