ppc: First cut implementation of -cpu host
commita1e985833cde3208b0f57c4c7e640b60fbc6c54d
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 12 Oct 2011 22:40:32 +0000 (12 22:40 +0000)
committerAlexander Graf <agraf@suse.de>
Sun, 30 Oct 2011 16:11:54 +0000 (30 17:11 +0100)
tree2432eab7cdf273d20cfab776518f6aecbebdcda1
parentbe40edcd87b8493cdf691dbe77049e0d9644dcc1
ppc: First cut implementation of -cpu host

For convenience with kvm, x86 allows the user to specify -cpu host on the
qemu command line, which means make the guest cpu the same as the host
cpu.  This patch implements the same option for ppc targets.

For now, this just read the host PVR (Processor Version Register) and
selects one of our existing CPU specs based on it.  This means that the
option will not work if the host cpu is not supported by TCG, even if that
wouldn't matter for use under kvm.

In future, we can extend this in future to override parts of the cpu spec
based on information obtained from the host (via /proc/cpuinfo, the host
device tree, or explicit KVM calls).  That will let us handle cases where
the real kvm-virtualized CPU doesn't behave exactly like the TCG-emulated
CPU.  With appropriate annotation of the CPU specs we'll also then be able
to use host cpus under kvm even when there isn't a matching full TCG model.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
target-ppc/cpu.h
target-ppc/kvm.c
target-ppc/kvm_ppc.h
target-ppc/translate_init.c