target-ppc: Create versionless CPU class per family if KVM
commit5b79b1cadd3e565b6d1a5ba59764bd47af58b271
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Fri, 11 Apr 2014 17:34:25 +0000 (12 03:34 +1000)
committerAlexander Graf <agraf@suse.de>
Mon, 16 Jun 2014 11:24:27 +0000 (16 13:24 +0200)
tree47c36c2e96ba0fd90561e4551107e8269c8c9044
parent8a286ce4502356ce0b97a2424a2cb7dfb31567f2
target-ppc: Create versionless CPU class per family if KVM

At the moment generic version-less CPUs are supported via hardcoded aliases.
For example, POWER7 is an alias for POWER7_v2.1. So when QEMU is started
with -cpu POWER7, the POWER7_v2.1 class instance is created.

This approach works for TCG and KVMs other than HV KVM. HV KVM cannot emulate
PVR value so the guest always sees the real PVR. HV KVM will not allow setting
PVR other that the host PVR because of that (the kernel patch for it is on
its way). So in most cases it is impossible to run QEMU with -cpu POWER7
unless the host PVR is exactly the same as the one from the alias (which
is now POWER7_v2.3). It was decided that under HV KVM QEMU should use
-cpu host.

Using "host" CPU type creates a problem for management tools such as libvirt
because they want to know in advance if the destination guest can possibly
run on the destination. Since the "host" type is really not a type and will
always work with any KVM, there is no way for libvirt to know if the migration
will success.

This registers additional CPU class derived from the host CPU family.
The name for it is taken from @desc field of the CPU family class.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
target-ppc/kvm.c