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: Hollis Blanchard
Subject: Re: [Qemu-devel] [PATCH 3/6] Enable KVM for ppcemb.
Date: Thu, 11 Dec 2008 18:04:28 -0600

On Thu, 2008-12-11 at 23:19 +0200, Blue Swirl wrote:
> >  +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?

Not a dumb question. Qemu won't change the floating point registers at
all, so there is no need to push to KVM. For debugging purposes ("info
registers" or gdbstub) it might be nice to pull the FP state from KVM,
but we simply haven't needed to do that so far.

-- 
Hollis Blanchard
IBM Linux Technology Center





reply via email to

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