Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-10 Thread Greg Kurz
On Thu, 10 Dec 2020 14:53:02 +1100 David Gibson wrote: > On Wed, Dec 09, 2020 at 01:26:17PM -0500, Eduardo Habkost wrote: > > On Wed, Dec 09, 2020 at 07:11:40PM +0100, Philippe Mathieu-Daudé wrote: > > [...] > > > @@ -200,7 +199,7 @@ static void spapr_cpu_core_reset(DeviceState > > > *

Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-10 Thread Cédric Le Goater
On 12/9/20 9:54 PM, Eduardo Habkost wrote: > On Wed, Dec 09, 2020 at 09:24:36PM +0100, Greg Kurz wrote: >> On Wed, 9 Dec 2020 13:26:17 -0500 >> Eduardo Habkost wrote: >> >>> On Wed, Dec 09, 2020 at 07:11:40PM +0100, Philippe Mathieu-Daudé wrote: >>> [...] @@ -200,7 +199,7 @@ static void s

Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-09 Thread David Gibson
On Wed, Dec 09, 2020 at 01:26:17PM -0500, Eduardo Habkost wrote: > On Wed, Dec 09, 2020 at 07:11:40PM +0100, Philippe Mathieu-Daudé wrote: > [...] > > @@ -200,7 +199,7 @@ static void spapr_cpu_core_reset(DeviceState *dev) > > int i; > > > > for (i = 0; i < cc->nr_thr

Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-09 Thread Eduardo Habkost
On Wed, Dec 09, 2020 at 09:24:36PM +0100, Greg Kurz wrote: > On Wed, 9 Dec 2020 13:26:17 -0500 > Eduardo Habkost wrote: > > > On Wed, Dec 09, 2020 at 07:11:40PM +0100, Philippe Mathieu-Daudé wrote: > > [...] > > > @@ -200,7 +199,7 @@ static void spapr_cpu_core_reset(DeviceState > > > *

Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-09 Thread Greg Kurz
On Wed, 9 Dec 2020 13:26:17 -0500 Eduardo Habkost wrote: > On Wed, Dec 09, 2020 at 07:11:40PM +0100, Philippe Mathieu-Daudé wrote: > [...] > > @@ -200,7 +199,7 @@ static void spapr_cpu_core_reset(DeviceState *dev) > > int i; > > > > for (i = 0; i < cc->nr_threads;

Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-09 Thread Eduardo Habkost
On Wed, Dec 09, 2020 at 07:11:40PM +0100, Philippe Mathieu-Daudé wrote: [...] > @@ -200,7 +199,7 @@ static void spapr_cpu_core_reset(DeviceState *dev) > int i; > > for (i = 0; i < cc->nr_threads; i++) { > -spapr_reset_vcpu(sc->threads[i]); > +

Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-09 Thread Philippe Mathieu-Daudé
On 12/9/20 6:53 PM, Philippe Mathieu-Daudé wrote: > On 12/9/20 6:42 PM, Greg Kurz wrote: >> On Wed, 9 Dec 2020 18:34:31 +0100 >> Philippe Mathieu-Daudé wrote: >> >>> On 12/9/20 6:00 PM, Greg Kurz wrote: The sPAPR CPU core device can only work with pseries machine types. This is currently

Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-09 Thread Philippe Mathieu-Daudé
On 12/9/20 6:42 PM, Greg Kurz wrote: > On Wed, 9 Dec 2020 18:34:31 +0100 > Philippe Mathieu-Daudé wrote: > >> On 12/9/20 6:00 PM, Greg Kurz wrote: >>> The sPAPR CPU core device can only work with pseries machine types. >>> This is currently checked in the realize function with a dynamic >>> cast

Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-09 Thread Greg Kurz
On Wed, 9 Dec 2020 18:34:31 +0100 Philippe Mathieu-Daudé wrote: > On 12/9/20 6:00 PM, Greg Kurz wrote: > > The sPAPR CPU core device can only work with pseries machine types. > > This is currently checked in the realize function with a dynamic > > cast of qdev_get_machine(). Some other places als

Re: [PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-09 Thread Philippe Mathieu-Daudé
On 12/9/20 6:00 PM, Greg Kurz wrote: > The sPAPR CPU core device can only work with pseries machine types. > This is currently checked in the realize function with a dynamic > cast of qdev_get_machine(). Some other places also need to reach > out to the machine using qdev_get_machine(). > > Make t

[PATCH 1/6] spapr: Add an "spapr" property to sPAPR CPU core

2020-12-09 Thread Greg Kurz
The sPAPR CPU core device can only work with pseries machine types. This is currently checked in the realize function with a dynamic cast of qdev_get_machine(). Some other places also need to reach out to the machine using qdev_get_machine(). Make this dependency explicit by introducing an "spapr"