From: Hollis Blanchard <hollisb@us.ibm.com>
To: Liu Yu <yu.liu@freescale.com>
Cc: jan.kiszka@siemens.com, froydnj@codesourcery.com,
qemu-devel@nongnu.org, kvm-ppc@vger.kernel.org,
Alexander Graf <alex@csgraf.de>
Subject: [Qemu-devel] Re: [PATCH 4/5] kvmppc: Translate eaddr for fsl_booke mmu
Date: Wed, 19 Aug 2009 15:51:24 -0700 [thread overview]
Message-ID: <1250722284.4237.53.camel@slab.beaverton.ibm.com> (raw)
In-Reply-To: <1249378568-18008-5-git-send-email-yu.liu@freescale.com>
On Tue, 2009-08-04 at 17:36 +0800, Liu Yu wrote:
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> ---
> target-ppc/helper.c | 17 +++++++++++++++--
> 1 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/target-ppc/helper.c b/target-ppc/helper.c
> index 6eca2e5..07e56a4 100644
> --- a/target-ppc/helper.c
> +++ b/target-ppc/helper.c
> @@ -22,6 +22,7 @@
> #include <string.h>
> #include <inttypes.h>
> #include <signal.h>
> +#include <linux/kvm.h>
>
> #include "cpu.h"
> #include "exec-all.h"
> @@ -1325,8 +1326,20 @@ static always_inline int check_physical (CPUState *env, mmu_ctx_t *ctx,
> cpu_abort(env, "MPC8xx MMU model is not implemented\n");
> break;
> case POWERPC_MMU_BOOKE_FSL:
> - /* XXX: TODO */
> - cpu_abort(env, "BookE FSL MMU model not implemented\n");
> + if (kvm_enabled()) {
> + struct kvm_translation tr;
> +
> + /* For now we only debug guest kernel */
> + tr.linear_address = eaddr;
> + ret = kvm_vcpu_ioctl(env, KVM_TRANSLATE, &tr);
> + if (ret < 0)
> + return ret;
> +
> + ctx->raddr = tr.physical_address;
> + } else {
> + /* XXX: TODO */
> + cpu_abort(env, "BookE FSL MMU model not implemented\n");
> + }
> break;
> default:
> cpu_abort(env, "Unknown or invalid MMU model\n");
One objection: the comment is a little obscure. I think what you're
really saying is "in Linux guests, kernel addresses should always be
covered by TLB1, which means for those addresses we can expect this
ioctl to succeed." However, since you need to handle failures anyways, I
think you should remove the comment entirely.
Second, (and this isn't an objection but rather a question) do you have
any better ideas for struct kvm_translation? It only really makes sense
for x86. We don't need to stick with it.
--
Hollis Blanchard
IBM Linux Technology Center
next prev parent reply other threads:[~2009-08-19 22:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-04 9:36 [Qemu-devel] [PATCH v2 0/5] kvmppc: Add guest debug support Liu Yu
2009-08-04 9:36 ` [Qemu-devel] [PATCH 1/5] kvmppc: Fix build error Liu Yu
2009-08-04 9:36 ` [Qemu-devel] [PATCH 2/5] kvmppc: Synchronize booke registers Liu Yu
2009-08-04 9:36 ` [Qemu-devel] [PATCH 3/5] kvmppc: Guest debug support Liu Yu
2009-08-04 9:36 ` [Qemu-devel] [PATCH 4/5] kvmppc: Translate eaddr for fsl_booke mmu Liu Yu
2009-08-04 9:36 ` [Qemu-devel] [PATCH 5/5] kvmppc: guest debug init Liu Yu
2009-08-19 22:51 ` Hollis Blanchard [this message]
2009-08-20 10:21 ` [Qemu-devel] RE: [PATCH 4/5] kvmppc: Translate eaddr for fsl_booke mmu Liu Yu-B13201
2009-08-21 12:38 ` [Qemu-devel] " Alexander Graf
2009-08-24 2:44 ` [Qemu-devel] " Liu Yu-B13201
2009-08-24 17:33 ` Hollis Blanchard
2009-08-29 21:48 ` [Qemu-devel] " Alexander Graf
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=1250722284.4237.53.camel@slab.beaverton.ibm.com \
--to=hollisb@us.ibm.com \
--cc=alex@csgraf.de \
--cc=froydnj@codesourcery.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=yu.liu@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).