|
| From: | Philippe Mathieu-Daudé |
| Subject: | Re: [PATCH v2 5/5] hw/intc/apic: Pass CPU using QOM link property |
| Date: | Mon, 16 Oct 2023 16:38:12 +0200 |
| User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 |
Hi Paolo, On 6/10/23 01:04, Paolo Bonzini wrote:
On 10/3/23 10:27, Philippe Mathieu-Daudé wrote:- /* TODO: convert to link<> */ - apic = APIC_COMMON(cpu->apic_state); - apic->cpu = cpu; - apic->apicbase = APIC_DEFAULT_ADDRESS | MSR_IA32_APICBASE_ENABLE; + qdev_prop_set_uint32(cpu->apic_state, "base-addr", + APIC_DEFAULT_ADDRESS | MSR_IA32_APICFor this to use a link, it's missing the corresponding object_unref(apic->cpu) + apic->cpu = NULL assignment somewhere. For example you can add it in apic_common_unrealize (called by device_unparent - which is called in turn by x86_cpu_unrealizefn).
I am a bit confused. DEFINE_PROP_LINK() sets OBJ_PROP_LINK_STRONG: * If the link property was created with * %OBJ_PROP_LINK_STRONG bit, the old target object is * unreferenced, and a reference is added to the new target object. Is this what you are pointing at? If so, I agree this should be unref in apic_common_unrealize().
| [Prev in Thread] | Current Thread | [Next in Thread] |