summaryrefslogtreecommitdiff
path: root/target-ppc
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2009-07-17 13:51:43 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-22 10:58:45 -0500
commit861bbc8052781e24bc1ecf3bbbe2c213d05ba889 (patch)
tree49713e3a212d02201ccec8718f3ebd78c9f21b1a /target-ppc
parent5f114bc6cea8798cbe6f22aa7963a5514119a353 (diff)
downloadqemu-861bbc8052781e24bc1ecf3bbbe2c213d05ba889.tar.gz
qemu-861bbc8052781e24bc1ecf3bbbe2c213d05ba889.tar.bz2
qemu-861bbc8052781e24bc1ecf3bbbe2c213d05ba889.zip
Set PVR in sregs
We need to tell the kernel about some initial CPU state we don't have yet, so let's use the "sregs" IOCTL for that and simply put the Processor Version Register in there. Now the kernel knows which guest CPU to virtualize. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'target-ppc')
-rw-r--r--target-ppc/kvm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index acbb1abd2b..04bb305a37 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -44,7 +44,13 @@ int kvm_arch_init(KVMState *s, int smp_cpus)
int kvm_arch_init_vcpu(CPUState *cenv)
{
- return 0;
+ int ret = 0;
+ struct kvm_sregs sregs;
+
+ sregs.pvr = cenv->spr[SPR_PVR];
+ ret = kvm_vcpu_ioctl(cenv, KVM_SET_SREGS, &sregs);
+
+ return ret;
}
int kvm_arch_put_registers(CPUState *env)