Commit 861bbc8052781e24bc1ecf3bbbe2c213d05ba889
Committed by
Anthony Liguori
1 parent
5f114bc6
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>
Showing
1 changed file
with
7 additions
and
1 deletions
target-ppc/kvm.c
... | ... | @@ -44,7 +44,13 @@ int kvm_arch_init(KVMState *s, int smp_cpus) |
44 | 44 | |
45 | 45 | int kvm_arch_init_vcpu(CPUState *cenv) |
46 | 46 | { |
47 | - return 0; | |
47 | + int ret = 0; | |
48 | + struct kvm_sregs sregs; | |
49 | + | |
50 | + sregs.pvr = cenv->spr[SPR_PVR]; | |
51 | + ret = kvm_vcpu_ioctl(cenv, KVM_SET_SREGS, &sregs); | |
52 | + | |
53 | + return ret; | |
48 | 54 | } |
49 | 55 | |
50 | 56 | int kvm_arch_put_registers(CPUState *env) | ... | ... |