summaryrefslogtreecommitdiff
path: root/target-ppc/kvm_ppc.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2011-09-29 21:39:10 +0000
committerAlexander Graf <agraf@suse.de>2011-10-30 17:11:53 +0100
commite97c363638b32943afc4bd2845f4081496fabfbc (patch)
treefefb166bb145fce87486ccd7f82c66c03162dfd1 /target-ppc/kvm_ppc.h
parenteeae2e7b52255dae0976a027b6e11274990c708d (diff)
downloadqemu-e97c363638b32943afc4bd2845f4081496fabfbc.tar.gz
pseries: Support SMT systems for KVM Book3S-HV
Alex Graf has already made qemu support KVM for the pseries machine when using the Book3S-PR KVM variant (which runs the guest in usermode, emulating supervisor operations). This code allows gets us very close to also working with KVM Book3S-HV (using the hypervisor capabilities of recent POWER CPUs). This patch moves us another step towards Book3S-HV support by correctly handling SMT (multithreaded) POWER CPUs. There are two parts to this: * Querying KVM to check SMT capability, and if present, adjusting the cpu numbers that qemu assigns to cause KVM to assign guest threads to cores in the right way (this isn't automatic, because the POWER HV support has a limitation that different threads on a single core cannot be in different guests at the same time). * Correctly informing the guest OS of the SMT thread to core mappings via the device tree. 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 c484e60bcb..c298411aa8 100644
--- a/target-ppc/kvm_ppc.h
+++ b/target-ppc/kvm_ppc.h
@@ -18,6 +18,7 @@ uint64_t kvmppc_get_clockfreq(void);
int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len);
int kvmppc_set_interrupt(CPUState *env, int irq, int level);
void kvmppc_set_papr(CPUState *env);
+int kvmppc_smt_threads(void);
#else
@@ -45,6 +46,11 @@ static inline void kvmppc_set_papr(CPUState *env)
{
}
+static inline int kvmppc_smt_threads(void)
+{
+ return 1;
+}
+
#endif
#ifndef CONFIG_KVM