aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/kvm_ppc.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2011-09-29 21:39:11 +0000
committerAlexander Graf <agraf@suse.de>2011-10-30 17:11:53 +0100
commit354ac20a36a82a5ee09b0a6c8ba8655358a7597f (patch)
tree1728b384c00b412a329179b72fc5f3bc69c90e06 /target-ppc/kvm_ppc.h
parente97c363638b32943afc4bd2845f4081496fabfbc (diff)
pseries: Allow KVM Book3S-HV on PPC970 CPUS
At present, using the hypervisor aware Book3S-HV KVM will only work with qemu on POWER7 CPUs. PPC970 CPUs also have hypervisor capability, but they lack the VRMA feature which makes assigning guest memory easier. In order to allow KVM Book3S-HV on PPC970, we need to specially allocate the first chunk of guest memory (the "Real Mode Area" or RMA), so that it is physically contiguous. Sufficiently recent host kernels allow such contiguous RMAs to be allocated, with a kvm capability advertising whether the feature is available and/or necessary on this hardware. This patch enables qemu to use this support, thus allowing kvm acceleration of pseries qemu machines on PPC970 hardware. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de> --- agraf: fix to use memory api
Diffstat (limited to 'target-ppc/kvm_ppc.h')
-rw-r--r--target-ppc/kvm_ppc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/target-ppc/kvm_ppc.h b/target-ppc/kvm_ppc.h
index c298411aa8..82f32f449e 100644
--- a/target-ppc/kvm_ppc.h
+++ b/target-ppc/kvm_ppc.h
@@ -9,6 +9,8 @@
#ifndef __KVM_PPC_H__
#define __KVM_PPC_H__
+#include "memory.h"
+
void kvmppc_init(void);
#ifdef CONFIG_KVM
@@ -19,6 +21,7 @@ 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);
+off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem);
#else
@@ -51,6 +54,11 @@ static inline int kvmppc_smt_threads(void)
return 1;
}
+static inline off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem)
+{
+ return 0;
+}
+
#endif
#ifndef CONFIG_KVM