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 <scottw...@freescale.com> > --- > 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