[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] monitor: add PPC BookE SPRs
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH] monitor: add PPC BookE SPRs |
Date: |
Fri, 29 Apr 2011 14:05:23 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
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 <address@hidden>
> ---
> 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