From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFmRu-00047Y-JU for qemu-devel@nongnu.org; Fri, 29 Apr 2011 08:05:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFmRt-0000Qd-8v for qemu-devel@nongnu.org; Fri, 29 Apr 2011 08:05:30 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:34156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFmRt-0000QA-0i for qemu-devel@nongnu.org; Fri, 29 Apr 2011 08:05:29 -0400 Message-ID: <4DBAA983.8050006@siemens.com> Date: Fri, 29 Apr 2011 14:05:23 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <20110428210130.GA15821@schlenkerla.am.freescale.net> In-Reply-To: <20110428210130.GA15821@schlenkerla.am.freescale.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@siemens.com Subject: Re: [Qemu-devel] [PATCH] monitor: add PPC BookE SPRs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Scott Wood Cc: agraf@suse.de, qemu-devel@nongnu.org On 2011-04-28 23:01, Scott Wood wrote: > Read them via KVM_GET_SREGS in kvm_arch_get_registers(), > and display them in "info registers". > > Also get CR and PID from the existing KVM_GET_REGS. > > Signed-off-by: Scott Wood > --- > hw/ppc.c | 12 +++++ > monitor.c | 71 +++++++++++++++++++++++++++- > target-ppc/cpu.h | 1 + > target-ppc/kvm.c | 123 ++++++++++++++++++++++++++++++++++++++++++++++- > target-ppc/translate.c | 82 +++++++++++++++++++++++++++++++- > 5 files changed, 282 insertions(+), 7 deletions(-) > ... > @@ -191,11 +197,122 @@ int kvm_arch_get_registers(CPUState *env) > env->spr[SPR_SPRG6] = regs.sprg6; > env->spr[SPR_SPRG7] = regs.sprg7; > > + env->spr[SPR_BOOKE_PID] = regs.pid; > + > for (i = 0;i < 32; i++) > env->gpr[i] = regs.gpr[i]; > > +#ifdef KVM_CAP_PPC_BOOKE_SREGS > + if (kvm_check_extension(env->kvm_state, KVM_CAP_PPC_BOOKE_SREGS)) { You probably want to cache the result of this syscall during init and check that here. There are plenty examples for this pattern around. > + ret = kvm_vcpu_ioctl(env, KVM_GET_SREGS, &sregs); > + if (ret < 0) > + return ret; Please use chechpatch.pl before submitting. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux