qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/6] Enable KVM for ppcemb.
Date: Thu, 11 Dec 2008 23:19:08 +0200	[thread overview]
Message-ID: <f43fc5580812111319y5651cdb4k5efb08450cd6c829@mail.gmail.com> (raw)
In-Reply-To: <a8986b56713649a250fb5f2435df33792d75e25c.1229027683.git.hollisb@us.ibm.com>

On 12/11/08, Hollis Blanchard <hollisb@us.ibm.com> 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 <hollisb@us.ibm.com>

>  +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	other threads:[~2008-12-11 21:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-11 20:52 [Qemu-devel] PowerPC KVM support Hollis Blanchard
2008-12-11 20:52 ` [Qemu-devel] [PATCH 1/6] Include headers for types used in helper_regs.h Hollis Blanchard
2008-12-11 20:52   ` [Qemu-devel] [PATCH 2/6] kvm: sync vcpu state during initialization Hollis Blanchard
2008-12-11 20:57     ` [Qemu-devel] " Hollis Blanchard
2008-12-11 21:24     ` [Qemu-devel] " Anthony Liguori
2008-12-13  0:23       ` Hollis Blanchard
2008-12-13  0:24         ` Hollis Blanchard
2008-12-13 16:37           ` Anthony Liguori
2008-12-11 20:52   ` [Qemu-devel] [PATCH 3/6] Enable KVM for ppcemb Hollis Blanchard
2008-12-11 21:19     ` Blue Swirl [this message]
2008-12-12  0:04       ` Hollis Blanchard
2008-12-11 21:30     ` Anthony Liguori
2008-12-11 22:54       ` Hollis Blanchard
2008-12-14  1:37         ` Hollis Blanchard
2008-12-14  3:29           ` Anthony Liguori
2008-12-11 20:52   ` [Qemu-devel] [PATCH 4/6] Implement device tree support needed for Bamboo emulation Hollis Blanchard
2008-12-11 21:33     ` Anthony Liguori
2008-12-11 20:52   ` [Qemu-devel] [PATCH 5/6] PowerPC 440EP SoC emulation Hollis Blanchard
2008-12-11 20:52   ` [Qemu-devel] [PATCH 6/6] IBM PowerPC 440EP Bamboo reference board emulation Hollis Blanchard
2008-12-11 21:25     ` Blue Swirl
2008-12-11 21:39     ` Anthony Liguori
2008-12-11 23:08       ` Hollis Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f43fc5580812111319y5651cdb4k5efb08450cd6c829@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).