From patchwork Tue Aug 4 09:36:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Yu-B13201 X-Patchwork-Id: 30719 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id B23B1B6F20 for ; Tue, 4 Aug 2009 19:57:40 +1000 (EST) Received: from localhost ([127.0.0.1]:45023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYGlx-0008H8-BG for incoming@patchwork.ozlabs.org; Tue, 04 Aug 2009 05:57:33 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MYGYj-0003dY-Ce for qemu-devel@nongnu.org; Tue, 04 Aug 2009 05:43:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYGYd-0003a4-P3 for qemu-devel@nongnu.org; Tue, 04 Aug 2009 05:43:52 -0400 Received: from [199.232.76.173] (port=60389 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYGYd-0003ZH-9U for qemu-devel@nongnu.org; Tue, 04 Aug 2009 05:43:47 -0400 Received: from az33egw02.freescale.net ([192.88.158.103]:36312) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MYGYb-00021M-Pp for qemu-devel@nongnu.org; Tue, 04 Aug 2009 05:43:46 -0400 Received: from de01smr01.freescale.net (de01smr01.freescale.net [10.208.0.31]) by az33egw02.freescale.net (8.14.3/az33egw02) with ESMTP id n749fc9i009597 for ; Tue, 4 Aug 2009 02:41:49 -0700 (MST) Received: from zch01exm26.fsl.freescale.net (zch01exm26.ap.freescale.net [10.192.129.221]) by de01smr01.freescale.net (8.13.1/8.13.0) with ESMTP id n749fvhE008366 for ; Tue, 4 Aug 2009 04:42:04 -0500 (CDT) Received: from localhost ([10.193.20.106]) by zch01exm26.fsl.freescale.net with Microsoft SMTPSVC(6.0.3790.3959); Tue, 4 Aug 2009 17:41:31 +0800 From: Liu Yu To: qemu-devel@nongnu.org Date: Tue, 4 Aug 2009 17:36:07 +0800 Message-Id: <1249378568-18008-5-git-send-email-yu.liu@freescale.com> X-Mailer: git-send-email 1.5.4 In-Reply-To: <1249378568-18008-4-git-send-email-yu.liu@freescale.com> References: <1249378568-18008-1-git-send-email-yu.liu@freescale.com> <1249378568-18008-2-git-send-email-yu.liu@freescale.com> <1249378568-18008-3-git-send-email-yu.liu@freescale.com> <1249378568-18008-4-git-send-email-yu.liu@freescale.com> X-OriginalArrivalTime: 04 Aug 2009 09:41:31.0414 (UTC) FILETIME=[BF5EC360:01CA14E7] X-Brightmail-Tracker: AAAAAQAAAWE= X-detected-operating-system: by monty-python.gnu.org: Solaris 8 (1) Cc: jan.kiszka@siemens.com, froydnj@codesourcery.com, Liu Yu , kvm-ppc@vger.kernel.org, hollisb@us.ibm.com Subject: [Qemu-devel] [PATCH 4/5] kvmppc: Translate eaddr for fsl_booke mmu X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Liu Yu --- 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 #include #include +#include #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");