提交 861bbc80 编写于 作者: A Alexander Graf 提交者: Anthony Liguori

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: NAlexander Graf <agraf@suse.de>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 5f114bc6
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册