spapr-cpu-core: Release ICPState object during CPU unrealization
PATCH 1/1 spapr-cpu-core: Release ICPState object during CPU unrealization
Recent commits that re-organized ICPState object missed to destroy the object when CPU is unrealized. Fix this so that CPU unplug doesn't abort QEMU.
--- hw/ppc/spapr_cpu_core.c | 1 + 1 file changed, 1 insertion(+)
hw/ppc/spapr_cpu_core.c +1 -0
@@ -127,6 +127,7 @@ static void spapr_cpu_core_unrealizefn(DeviceState *dev, Error **errp)PowerPCCPU *cpu =POWERPC_CPU (cs);spapr_cpu_destroy (cpu); +object_unparent (cpu->intc);cpu_remove_sync (cs);object_unparent (obj); }
Signature · 1 line
2.7.4
This should be considered for ppc-for-2.10 branch of dwg's tree.
Quoted 23 lines · Bharata B Rao
Recent commits that re-organized ICPState object missed to destroy the object when CPU is unrealized. Fix this so that CPU unplug doesn't abort QEMU.
Signed-off-by Bharata B Rao <[email protected]>--- hw/ppc/spapr_cpu_core.c | 1 + 1 file changed, 1 insertion(+)hw/ppc/spapr_cpu_core.c +1
-0@@ -127,6 +127,7 @@ static void spapr_cpu_core_unrealizefn(DeviceState *dev, Error **errp)PowerPCCPU *cpu =POWERPC_CPU (cs);spapr_cpu_destroy (cpu); +object_unparent (cpu->intc);cpu_remove_sync (cs);object_unparent (obj); }Signature · 1 line
2.7.4
Quoted 3 lines · Bharata B Rao
Recent commits that re-organized ICPState object missed to destroy the object when CPU is unrealized. Fix this so that CPU unplug doesn't abort QEMU.
Indeed.
Quoted 1 line
Signed-off-by Bharata B Rao <[email protected]>
I am wondering if we should not be doing the unparent under spapr_cpu_destroy() or even xics_cpu_destroy(). Apart from that,
Thanks,
C.
Quoted 17 lines
--- hw/ppc/spapr_cpu_core.c | 1 + 1 file changed, 1 insertion(+)hw/ppc/spapr_cpu_core.c +1
-0@@ -127,6 +127,7 @@ static void spapr_cpu_core_unrealizefn(DeviceState *dev, Error **errp)PowerPCCPU *cpu =POWERPC_CPU (cs);spapr_cpu_destroy (cpu); +object_unparent (cpu->intc);cpu_remove_sync (cs);object_unparent (obj); }
Quoted 5 lines · Cédric Le Goater
Quoted 3 lines · Bharata B Rao
Recent commits that re-organized ICPState object missed to destroy the object when CPU is unrealized. Fix this so that CPU unplug doesn't abort QEMU.
Quoted 7 lines
Indeed.
Quoted 1 line
Signed-off-by Bharata B Rao <[email protected]>I am wondering if we should not be doing the unparent under
spapr_cpu_destroy()or evenxics_cpu_destroy(). Apart from that,
Thought so, but since object is created in realize routinte itself (and not in any of its callers), did the object destruction in unrealize to be symmetrical :)
Regards,
Bharata.
Quoted 10 lines · Bharata B Rao
Quoted 9 lines · Cédric Le Goater
Quoted 3 lines · Bharata B Rao
Recent commits that re-organized ICPState object missed to destroy the object when CPU is unrealized. Fix this so that CPU unplug doesn't abort QEMU.
Indeed.
Quoted 1 line
Signed-off-by Bharata B Rao <[email protected]>
Quoted 7 lines
Quoted 3 lines
I am wondering if we should not be doing the unparent under
spapr_cpu_destroy()or evenxics_cpu_destroy(). Apart from that,Thought so, but since object is created in realize routinte itself (and not in any of its callers), did the object destruction in unrealize to be symmetrical :)
yes. I think it is a good pratice to unparent/free the object in the same file it was allocated.
Thanks,
C.
David Gibson
AppliedQuoted 5 lines · Bharata B Rao
Recent commits that re-organized ICPState object missed to destroy the object when CPU is unrealized. Fix this so that CPU unplug doesn't abort QEMU.
Signed-off-by Bharata B Rao <[email protected]>
Applied to ppc-for-2.10, thanks.
Quoted 16 lines
--- hw/ppc/spapr_cpu_core.c | 1 + 1 file changed, 1 insertion(+)hw/ppc/spapr_cpu_core.c +1
-0@@ -127,6 +127,7 @@ static void spapr_cpu_core_unrealizefn(DeviceState *dev, Error **errp)PowerPCCPU *cpu =POWERPC_CPU (cs);spapr_cpu_destroy (cpu); +object_unparent (cpu->intc);cpu_remove_sync (cs);object_unparent (obj); }
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson