ppc/kvm: Handle the "family" CPU via alias instead of registering new types
commit715d4b96a444717ec1e5c3b10293b0315700b210
authorThomas Huth <thuth@redhat.com>
Tue, 31 Jan 2017 13:11:58 +0000 (31 14:11 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 1 Feb 2017 22:30:07 +0000 (2 09:30 +1100)
tree24352c48b732df7c17b4b8f871450e3958cdaf4a
parent6925f12f4f02e55c73e738cb9e91e8cda2f23358
ppc/kvm: Handle the "family" CPU via alias instead of registering new types

When running with KVM on POWER, we are registering a "family" CPU
type for the host CPU that we are running on. For example, on all
POWER8-compatible hosts, we register a "POWER8" CPU type, so that
you can always start QEMU with "-cpu POWER8" there, without the
need to know whether you are running on a POWER8, POWER8E or POWER8NVL
host machine.
However, we also have a "POWER8" CPU alias in the ppc_cpu_aliases list
(that is mainly useful for TCG). This leads to two cosmetical drawbacks:
If the user runs QEMU with "-cpu ?", we always claim that POWER8 is an
"alias for POWER8_v2.0" - which is simply not true when running with
KVM on POWER. And when using the 'query-cpu-definitions' QMP call,
there are currently two entries for "POWER8", one for the alias, and
one for the additional registered type.
To solve the two problems, we should rather update the "family" alias
instead of registering a new types. We then only have one "POWER8"
CPU definition around, an alias, which also points to the right
destination.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1396536
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target/ppc/kvm.c