ppc: pnv: use generic cpu_model parsing
commit4a12c699d3fe08087381bd633284abae689b3999
authorIgor Mammedov <imammedo@redhat.com>
Mon, 9 Oct 2017 19:51:06 +0000 (9 21:51 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 16 Oct 2017 23:34:01 +0000 (17 10:34 +1100)
tree230c089d657295fed997d8f7ca2dd1e78a362050
parent2e9c10eba0206e7b9a5ed03e51269759caac27f0
ppc: pnv: use generic cpu_model parsing

use common cpu_model prasing in vl.c and set default cpu_model
using generic MachineClass::default_cpu_type.

Beside of switching to generic infrastructure it solves several
issues.

 * ppc_cpu_class_by_name() is used to deal with lower/upper case
   and alias translations into actual cpu type, which fixes
    '-M powernv -cpu power8' and '-M powernv -cpu power9_v1.0'
   usecases which error out with:
    'invalid CPU model 'FOO' for powernv machine'
 * allows to switch to lower-case typenames in pnv chip/core name
   (by convention typnames should be lower-case)
 * replace aliased names /power8, power9, .../ with exact cpu model
   names (i.e. typenames should be stable but aliases might decide to
   point to other cpu model withi family or changed by kvm). It will
   also help to simplify pnv_chip/core code and get rid of dependency
   on cpu_model parsing.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
[dwg: Updated to make DD2.0 as default POWER9 chip]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/pnv.c
hw/ppc/pnv_core.c
include/hw/ppc/pnv.h