From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAvWD-00086u-Dx for qemu-devel@nongnu.org; Thu, 11 Dec 2008 19:04:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAvWC-00085i-A9 for qemu-devel@nongnu.org; Thu, 11 Dec 2008 19:04:32 -0500 Received: from [199.232.76.173] (port=39171 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAvWC-00085c-6C for qemu-devel@nongnu.org; Thu, 11 Dec 2008 19:04:32 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:37868) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LAvWB-0007pX-GE for qemu-devel@nongnu.org; Thu, 11 Dec 2008 19:04:31 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e8.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id mBBNxb7x016653 for ; Thu, 11 Dec 2008 18:59:37 -0500 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mBC04Rn7188792 for ; Thu, 11 Dec 2008 19:04:27 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mBC04R88020854 for ; Thu, 11 Dec 2008 19:04:27 -0500 Received: from [9.53.41.42] (slate.austin.ibm.com [9.53.41.42]) by d01av03.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id mBC04QX1020850 for ; Thu, 11 Dec 2008 19:04:27 -0500 Subject: Re: [Qemu-devel] [PATCH 3/6] Enable KVM for ppcemb. From: Hollis Blanchard In-Reply-To: References: <9de3436f36e5c5717dffa2155fe098367b4e2153.1229027683.git.hollisb@us.ibm.com> Content-Type: text/plain Date: Thu, 11 Dec 2008 18:04:28 -0600 Message-Id: <1229040268.26586.52.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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 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, ®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? 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