From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAt7v-0006JN-Ft for qemu-devel@nongnu.org; Thu, 11 Dec 2008 16:31:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAt7u-0006IP-Ld for qemu-devel@nongnu.org; Thu, 11 Dec 2008 16:31:18 -0500 Received: from [199.232.76.173] (port=36636 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAt7u-0006IC-EL for qemu-devel@nongnu.org; Thu, 11 Dec 2008 16:31:18 -0500 Received: from mail-bw0-f12.google.com ([209.85.218.12]:46408) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LAt7t-0002li-MG for qemu-devel@nongnu.org; Thu, 11 Dec 2008 16:31:18 -0500 Received: by bwz5 with SMTP id 5so1320814bwz.10 for ; Thu, 11 Dec 2008 13:31:16 -0800 (PST) Message-ID: Date: Thu, 11 Dec 2008 23:19:08 +0200 From: "Blue Swirl" Subject: Re: [Qemu-devel] [PATCH 3/6] Enable KVM for ppcemb. In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9de3436f36e5c5717dffa2155fe098367b4e2153.1229027683.git.hollisb@us.ibm.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 12/11/08, Hollis Blanchard 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 > +int kvm_arch_put_registers(CPUState *env) > +{ > + struct kvm_regs regs; > + int ret; > + int i; > + > + ret = kvm_vcpu_ioctl(env, KVM_GET_REGS, ®s); > + 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, ®s); > + 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.