diff mbox series

[16/23] ppc: spapr: use cpu model names as tcg defaults instead of aliases

Message ID 1507220690-265042-17-git-send-email-imammedo@redhat.com
State New
Headers show
Series generalize parsing of cpu_model (part 3/PPC) | expand

Commit Message

Igor Mammedov Oct. 5, 2017, 4:24 p.m. UTC
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/ppc/spapr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Gibson Oct. 6, 2017, 4:43 a.m. UTC | #1
On Thu, Oct 05, 2017 at 06:24:43PM +0200, Igor Mammedov wrote:
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  hw/ppc/spapr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index ad7afd6..0661dba 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -3603,7 +3603,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
>      hc->unplug_request = spapr_machine_device_unplug_request;
>  
>      smc->dr_lmb_enabled = true;
> -    smc->tcg_default_cpu = "POWER8";
> +    smc->tcg_default_cpu = "power8_v2.0";
>      mc->has_hotpluggable_cpus = true;
>      smc->resize_hpt_default = SPAPR_RESIZE_HPT_ENABLED;
>      fwc->get_dev_path = spapr_get_fw_dev_path;
> @@ -3849,7 +3849,7 @@ static void spapr_machine_2_7_class_options(MachineClass *mc)
>      sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
>  
>      spapr_machine_2_8_class_options(mc);
> -    smc->tcg_default_cpu = "POWER7";
> +    smc->tcg_default_cpu = "power7_v2.3";
>      SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7);
>      smc->phb_placement = phb_placement_2_7;
>  }
Greg Kurz Oct. 6, 2017, 7:39 a.m. UTC | #2
On Thu,  5 Oct 2017 18:24:43 +0200
Igor Mammedov <imammedo@redhat.com> wrote:

> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---

So... this is preparatory work for the next patch because the generic cpu_model
parsing code doesn't handle aliases, is it ?

>  hw/ppc/spapr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index ad7afd6..0661dba 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -3603,7 +3603,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
>      hc->unplug_request = spapr_machine_device_unplug_request;
>  
>      smc->dr_lmb_enabled = true;
> -    smc->tcg_default_cpu = "POWER8";
> +    smc->tcg_default_cpu = "power8_v2.0";
>      mc->has_hotpluggable_cpus = true;
>      smc->resize_hpt_default = SPAPR_RESIZE_HPT_ENABLED;
>      fwc->get_dev_path = spapr_get_fw_dev_path;
> @@ -3849,7 +3849,7 @@ static void spapr_machine_2_7_class_options(MachineClass *mc)
>      sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
>  
>      spapr_machine_2_8_class_options(mc);
> -    smc->tcg_default_cpu = "POWER7";
> +    smc->tcg_default_cpu = "power7_v2.3";
>      SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7);
>      smc->phb_placement = phb_placement_2_7;
>  }
Igor Mammedov Oct. 6, 2017, 9:27 a.m. UTC | #3
On Fri, 6 Oct 2017 09:39:25 +0200
Greg Kurz <groug@kaod.org> wrote:

> On Thu,  5 Oct 2017 18:24:43 +0200
> Igor Mammedov <imammedo@redhat.com> wrote:
> 
> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> > ---  
> 
> So... this is preparatory work for the next patch because the generic cpu_model
> parsing code doesn't handle aliases, is it ?
generic parsing does handle aliases thanks to ppc_cpu_class_by_name() callback
but generic parsing doesn't parse default cpu model as it doesn't exists
it works with default cpu TYPE.

So yes it's preparation for the next patch where exact default cpu model
is converted into cpu type with help of POWERPC_CPU_TYPE_NAME(), like its done
everywhere else.

> 
> >  hw/ppc/spapr.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index ad7afd6..0661dba 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -3603,7 +3603,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
> >      hc->unplug_request = spapr_machine_device_unplug_request;
> >  
> >      smc->dr_lmb_enabled = true;
> > -    smc->tcg_default_cpu = "POWER8";
> > +    smc->tcg_default_cpu = "power8_v2.0";
> >      mc->has_hotpluggable_cpus = true;
> >      smc->resize_hpt_default = SPAPR_RESIZE_HPT_ENABLED;
> >      fwc->get_dev_path = spapr_get_fw_dev_path;
> > @@ -3849,7 +3849,7 @@ static void spapr_machine_2_7_class_options(MachineClass *mc)
> >      sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
> >  
> >      spapr_machine_2_8_class_options(mc);
> > -    smc->tcg_default_cpu = "POWER7";
> > +    smc->tcg_default_cpu = "power7_v2.3";
> >      SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7);
> >      smc->phb_placement = phb_placement_2_7;
> >  }  
>
Greg Kurz Oct. 6, 2017, 10:12 a.m. UTC | #4
On Fri, 6 Oct 2017 11:27:10 +0200
Igor Mammedov <imammedo@redhat.com> wrote:

> On Fri, 6 Oct 2017 09:39:25 +0200
> Greg Kurz <groug@kaod.org> wrote:
> 
> > On Thu,  5 Oct 2017 18:24:43 +0200
> > Igor Mammedov <imammedo@redhat.com> wrote:
> >   
> > > Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> > > ---    
> > 
> > So... this is preparatory work for the next patch because the generic cpu_model
> > parsing code doesn't handle aliases, is it ?  
> generic parsing does handle aliases thanks to ppc_cpu_class_by_name() callback
> but generic parsing doesn't parse default cpu model as it doesn't exists
> it works with default cpu TYPE.
> 
> So yes it's preparation for the next patch where exact default cpu model
> is converted into cpu type with help of POWERPC_CPU_TYPE_NAME(), like its done
> everywhere else.
> 

I understand now, thanks for the clarification.

Maybe this patch could have been folded into the next one then, but anyway
the change is fine.

Reviewed-by: Greg Kurz <groug@kaod.org>

> >   
> > >  hw/ppc/spapr.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > > index ad7afd6..0661dba 100644
> > > --- a/hw/ppc/spapr.c
> > > +++ b/hw/ppc/spapr.c
> > > @@ -3603,7 +3603,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
> > >      hc->unplug_request = spapr_machine_device_unplug_request;
> > >  
> > >      smc->dr_lmb_enabled = true;
> > > -    smc->tcg_default_cpu = "POWER8";
> > > +    smc->tcg_default_cpu = "power8_v2.0";
> > >      mc->has_hotpluggable_cpus = true;
> > >      smc->resize_hpt_default = SPAPR_RESIZE_HPT_ENABLED;
> > >      fwc->get_dev_path = spapr_get_fw_dev_path;
> > > @@ -3849,7 +3849,7 @@ static void spapr_machine_2_7_class_options(MachineClass *mc)
> > >      sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
> > >  
> > >      spapr_machine_2_8_class_options(mc);
> > > -    smc->tcg_default_cpu = "POWER7";
> > > +    smc->tcg_default_cpu = "power7_v2.3";
> > >      SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7);
> > >      smc->phb_placement = phb_placement_2_7;
> > >  }    
> >   
>
diff mbox series

Patch

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index ad7afd6..0661dba 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3603,7 +3603,7 @@  static void spapr_machine_class_init(ObjectClass *oc, void *data)
     hc->unplug_request = spapr_machine_device_unplug_request;
 
     smc->dr_lmb_enabled = true;
-    smc->tcg_default_cpu = "POWER8";
+    smc->tcg_default_cpu = "power8_v2.0";
     mc->has_hotpluggable_cpus = true;
     smc->resize_hpt_default = SPAPR_RESIZE_HPT_ENABLED;
     fwc->get_dev_path = spapr_get_fw_dev_path;
@@ -3849,7 +3849,7 @@  static void spapr_machine_2_7_class_options(MachineClass *mc)
     sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
 
     spapr_machine_2_8_class_options(mc);
-    smc->tcg_default_cpu = "POWER7";
+    smc->tcg_default_cpu = "power7_v2.3";
     SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7);
     smc->phb_placement = phb_placement_2_7;
 }