aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/kvm_ppc.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2011-10-12 22:40:32 +0000
committerAlexander Graf <agraf@suse.de>2011-10-30 17:11:54 +0100
commita1e985833cde3208b0f57c4c7e640b60fbc6c54d (patch)
tree2432eab7cdf273d20cfab776518f6aecbebdcda1 /target-ppc/kvm_ppc.h
parentbe40edcd87b8493cdf691dbe77049e0d9644dcc1 (diff)
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>
Diffstat (limited to 'target-ppc/kvm_ppc.h')
-rw-r--r--target-ppc/kvm_ppc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/target-ppc/kvm_ppc.h b/target-ppc/kvm_ppc.h
index 955729a1cf..b0d6fb667e 100644
--- a/target-ppc/kvm_ppc.h
+++ b/target-ppc/kvm_ppc.h
@@ -26,6 +26,7 @@ int kvmppc_smt_threads(void);
off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem);
void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd);
int kvmppc_remove_spapr_tce(void *table, int pfd, uint32_t window_size);
+const ppc_def_t *kvmppc_host_cpu_def(void);
#else
@@ -85,6 +86,11 @@ static inline int kvmppc_remove_spapr_tce(void *table, int pfd,
return -1;
}
+static inline const ppc_def_t *kvmppc_host_cpu_def(void)
+{
+ return NULL;
+}
+
#endif
#ifndef CONFIG_KVM