All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] spapr-cpu-core: Release ICPState object during CPU unrealization
@ 2017-04-12  8:15 Bharata B Rao
  2017-04-12  8:21 ` Bharata B Rao
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bharata B Rao @ 2017-04-12  8:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, david, clg, 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 <bharata@linux.vnet.ibm.com>
---
 hw/ppc/spapr_cpu_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 2e689b5..4389ef4 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -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);
     }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] spapr-cpu-core: Release ICPState object during CPU unrealization
  2017-04-12  8:15 [Qemu-devel] [PATCH] spapr-cpu-core: Release ICPState object during CPU unrealization Bharata B Rao
@ 2017-04-12  8:21 ` Bharata B Rao
  2017-04-12  8:47 ` Cédric Le Goater
  2017-04-13  2:54 ` David Gibson
  2 siblings, 0 replies; 6+ messages in thread
From: Bharata B Rao @ 2017-04-12  8:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, david, clg

This should be considered for ppc-for-2.10 branch of dwg's tree.

On Wed, Apr 12, 2017 at 01:45:07PM +0530, Bharata B Rao wrote:
> 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 <bharata@linux.vnet.ibm.com>
> ---
>  hw/ppc/spapr_cpu_core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
> index 2e689b5..4389ef4 100644
> --- a/hw/ppc/spapr_cpu_core.c
> +++ b/hw/ppc/spapr_cpu_core.c
> @@ -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);
>      }
> -- 
> 2.7.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] spapr-cpu-core: Release ICPState object during CPU unrealization
  2017-04-12  8:15 [Qemu-devel] [PATCH] spapr-cpu-core: Release ICPState object during CPU unrealization Bharata B Rao
  2017-04-12  8:21 ` Bharata B Rao
@ 2017-04-12  8:47 ` Cédric Le Goater
  2017-04-12  8:53   ` Bharata B Rao
  2017-04-13  2:54 ` David Gibson
  2 siblings, 1 reply; 6+ messages in thread
From: Cédric Le Goater @ 2017-04-12  8:47 UTC (permalink / raw)
  To: Bharata B Rao, qemu-devel; +Cc: qemu-ppc, david

On 04/12/2017 10:15 AM, Bharata B Rao wrote:
> 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.

> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>

I am wondering if we should not be doing the unparent under 
spapr_cpu_destroy() or even xics_cpu_destroy(). Apart from
that, 

Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
>  hw/ppc/spapr_cpu_core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
> index 2e689b5..4389ef4 100644
> --- a/hw/ppc/spapr_cpu_core.c
> +++ b/hw/ppc/spapr_cpu_core.c
> @@ -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);
>      }
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] spapr-cpu-core: Release ICPState object during CPU unrealization
  2017-04-12  8:47 ` Cédric Le Goater
@ 2017-04-12  8:53   ` Bharata B Rao
  2017-04-12  9:03     ` Cédric Le Goater
  0 siblings, 1 reply; 6+ messages in thread
From: Bharata B Rao @ 2017-04-12  8:53 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: qemu-devel, qemu-ppc, david

On Wed, Apr 12, 2017 at 10:47:39AM +0200, Cédric Le Goater wrote:
> On 04/12/2017 10:15 AM, Bharata B Rao wrote:
> > 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.
> 
> > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> 
> I am wondering if we should not be doing the unparent under 
> spapr_cpu_destroy() or even xics_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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] spapr-cpu-core: Release ICPState object during CPU unrealization
  2017-04-12  8:53   ` Bharata B Rao
@ 2017-04-12  9:03     ` Cédric Le Goater
  0 siblings, 0 replies; 6+ messages in thread
From: Cédric Le Goater @ 2017-04-12  9:03 UTC (permalink / raw)
  To: bharata; +Cc: qemu-devel, qemu-ppc, david

On 04/12/2017 10:53 AM, Bharata B Rao wrote:
> On Wed, Apr 12, 2017 at 10:47:39AM +0200, Cédric Le Goater wrote:
>> On 04/12/2017 10:15 AM, Bharata B Rao wrote:
>>> 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.
>>
>>> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
>>
>> I am wondering if we should not be doing the unparent under 
>> spapr_cpu_destroy() or even xics_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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] spapr-cpu-core: Release ICPState object during CPU unrealization
  2017-04-12  8:15 [Qemu-devel] [PATCH] spapr-cpu-core: Release ICPState object during CPU unrealization Bharata B Rao
  2017-04-12  8:21 ` Bharata B Rao
  2017-04-12  8:47 ` Cédric Le Goater
@ 2017-04-13  2:54 ` David Gibson
  2 siblings, 0 replies; 6+ messages in thread
From: David Gibson @ 2017-04-13  2:54 UTC (permalink / raw)
  To: Bharata B Rao; +Cc: qemu-devel, qemu-ppc, clg

[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]

On Wed, Apr 12, 2017 at 01:45:07PM +0530, Bharata B Rao wrote:
> 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 <bharata@linux.vnet.ibm.com>

Applied to ppc-for-2.10, thanks.

> ---
>  hw/ppc/spapr_cpu_core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
> index 2e689b5..4389ef4 100644
> --- a/hw/ppc/spapr_cpu_core.c
> +++ b/hw/ppc/spapr_cpu_core.c
> @@ -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);
>      }

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-13  3:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-12  8:15 [Qemu-devel] [PATCH] spapr-cpu-core: Release ICPState object during CPU unrealization Bharata B Rao
2017-04-12  8:21 ` Bharata B Rao
2017-04-12  8:47 ` Cédric Le Goater
2017-04-12  8:53   ` Bharata B Rao
2017-04-12  9:03     ` Cédric Le Goater
2017-04-13  2:54 ` David Gibson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.