From: Jan Kiszka <jan.kiszka@siemens.com>
To: Scott Wood <scottwood@freescale.com>
Cc: agraf@suse.de, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] monitor: add PPC BookE SPRs
Date: Fri, 29 Apr 2011 14:05:23 +0200 [thread overview]
Message-ID: <4DBAA983.8050006@siemens.com> (raw)
In-Reply-To: <20110428210130.GA15821@schlenkerla.am.freescale.net>
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 <scottwood@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
next prev parent reply other threads:[~2011-04-29 12:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-28 21:01 [Qemu-devel] [PATCH] monitor: add PPC BookE SPRs Scott Wood
2011-04-29 12:05 ` Jan Kiszka [this message]
2011-04-29 15:49 ` Scott Wood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DBAA983.8050006@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=scottwood@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).