qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/6] Enable KVM for ppcemb.


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH 3/6] Enable KVM for ppcemb.
Date: Thu, 11 Dec 2008 23:19:08 +0200

On 12/11/08, Hollis Blanchard <address@hidden> wrote:
> 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>

>  +int kvm_arch_put_registers(CPUState *env)
>  +{
>  +       struct kvm_regs regs;
>  +       int ret;
>  +       int i;
>  +
>  +       ret = kvm_vcpu_ioctl(env, KVM_GET_REGS, &regs);
>  +       if (ret < 0)
>  +               return ret;
>  +
>  +       /* cr is untouched in qemu and not existant in CPUState fr ppr */
>  +       /* hflags is a morphed to MSR on ppc, no need to sync that down to 
> kvm */
>  +
>  +       regs.pc = env->nip;
>  +
>  +       regs.ctr = env->ctr;
>  +       regs.lr  = env->lr;
>  +       regs.xer = env->xer;
>  +       regs.msr = env->msr;
>  +
>  +       regs.srr0 = env->spr[SPR_SRR0];
>  +       regs.srr1 = env->spr[SPR_SRR1];
>  +
>  +       regs.sprg0 = env->spr[SPR_SPRG0];
>  +       regs.sprg1 = env->spr[SPR_SPRG1];
>  +       regs.sprg2 = env->spr[SPR_SPRG2];
>  +       regs.sprg3 = env->spr[SPR_SPRG3];
>  +       regs.sprg4 = env->spr[SPR_SPRG4];
>  +       regs.sprg5 = env->spr[SPR_SPRG5];
>  +       regs.sprg6 = env->spr[SPR_SPRG6];
>  +       regs.sprg7 = env->spr[SPR_SPRG7];
>  +
>  +       for (i = 0;i < 32; i++)
>  +               regs.gpr[i] = env->gpr[i];
>  +
>  +       ret = kvm_vcpu_ioctl(env, KVM_SET_REGS, &regs);
>  +       if (ret < 0)
>  +               return ret;
>  +
>  +       return ret;
>  +}

Maybe this is a dumb question, but why don't you get/put floating
point registers?

>  +#include "device_tree.h"

The sequencing is not correct, you introduce FDT in #4.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]