Implement hooks called by generic KVM code.
Also add code that will copy the host's CPU and timebase frequencies to the
guest, which is necessary on KVM because the guest can directly access the
timebase.
Signed-off-by: Hollis Blanchard <address@hidden>
---
Makefile.target | 3 +
configure | 6 ++
target-ppc/helper.c | 5 +
target-ppc/kvm.c | 212 ++++++++++++++++++++++++++++++++++++++++++++++++++
target-ppc/kvm_ppc.c | 105 +++++++++++++++++++++++++
target-ppc/kvm_ppc.h | 15 ++++
6 files changed, 346 insertions(+), 0 deletions(-)
create mode 100644 target-ppc/kvm.c
create mode 100644 target-ppc/kvm_ppc.c
create mode 100644 target-ppc/kvm_ppc.h
diff --git a/Makefile.target b/Makefile.target
index 7152dff..d01231d 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -652,6 +652,9 @@ OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
OBJS+= unin_pci.o ppc_chrp.o
# PowerPC 4xx boards
OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
+ifdef CONFIG_KVM
+OBJS+= kvm_ppc.o
+endif
+int kvm_arch_get_registers(CPUState *env)
+{
+ struct kvm_regs regs;
+ uint32_t i, ret;
+
+ ret = kvm_vcpu_ioctl(env, KVM_GET_REGS, ®s);
+ if (ret < 0)
+ return ret;
+
+ env->ctr = regs.ctr;
+ env->lr = regs.lr;
+ env->xer = regs.xer;
+ env->msr = regs.msr;
+ /* calculate hflags based on the current msr using the ppc qemu helper
*/
+ hreg_compute_hflags(env);