[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH qom-next 05/59] apic: Replace cpu_env pointer by
Re: [Qemu-devel] [PATCH qom-next 05/59] apic: Replace cpu_env pointer by X86CPU link
Wed, 11 Jul 2012 12:47:23 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1
On 05/23/2012 05:07 AM, Andreas Färber wrote:
Needed for converting cpu_is_bsp().
Signed-off-by: Andreas Färber <address@hidden>
Cc: Paolo Bonzini <address@hidden>
@@ -899,7 +900,13 @@ static DeviceState *apic_init(void *env, uint8_t apic_id)
qdev_prop_set_uint8(dev, "id", apic_id);
- qdev_prop_set_ptr(dev, "cpu_env", env);
+ object_property_set_link(OBJECT(dev), OBJECT(ENV_GET_CPU(env)), "cpu",
Setting back-link should be done before or inside of x86_cpu_realize(),
i.e. no CPU internals outside of CPU object.
But that depends on CPU becoming a child of something between
and x86_cpu_realize(), otherwise it would crash in object_property_set_link ().
Currently it could be done in target-i386/helper.c:cpu_x86_init()but not in
hw/pc.c:pc_new_cpu() because cpu_x86_init() returns realized CPU.
Perhaps we should wait with this and previous patch till APIC is moved inside
As a way to avoid back-link issue we could make CPU a child of /machine in
cpu_x86_init() before callling x86_cpu_realize(). Yes, it won't be at board
level but it won't
hurt *-user target and might be acceptable sacrifice for i386-softmmu in effort
x86cpu and converting from qdev_prop_set_ptr() to object_property_set_link().
|[Prev in Thread]
||[Next in Thread]|
- Re: [Qemu-devel] [PATCH qom-next 05/59] apic: Replace cpu_env pointer by X86CPU link,
Igor Mammedov <=