From patchwork Wed Jan 18 22:38:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9524911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B8A72601B7 for ; Wed, 18 Jan 2017 22:57:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A888728564 for ; Wed, 18 Jan 2017 22:57:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98B022863E; Wed, 18 Jan 2017 22:57:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 20BFB28564 for ; Wed, 18 Jan 2017 22:57:45 +0000 (UTC) Received: from localhost ([::1]:44867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTzAm-0004le-0H for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Jan 2017 17:57:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTytE-0006dA-4V for qemu-devel@nongnu.org; Wed, 18 Jan 2017 17:39:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTytD-0002pJ-Au for qemu-devel@nongnu.org; Wed, 18 Jan 2017 17:39:36 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cTytD-0002ox-4K for qemu-devel@nongnu.org; Wed, 18 Jan 2017 17:39:35 -0500 Received: by mail-wm0-x244.google.com with SMTP id r144so7568190wme.0 for ; Wed, 18 Jan 2017 14:39:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iXra0kI3tMSTcQMi3fDas8dS/Ooc2907ztpP+gA0Npk=; b=XekUQ0McrftUaK1iyy01tLCi904IY8YEWtpr3DEYm+KfpNYqUNtpXVvU6mFFhP2NxT PZZUsC/+aPX/J31yaybSoi1U9+417d4veirZAWEqPxMPlT0murxVggQLpvhTBFen5sAz aWE7Pxei1uSLjAYLtkIpdtuU1Kuluoy2swzxbhgw4AYloDC0dhLLgpC242SjWuqBvg7L v88btsKZS8ZGI/k3lKxeHp6O1Coody8Dl1RuHjyH/7T4siDMaFtfjgH+Gu1bFSZAC1FO CMgUWAfE6OhePIdmeOx8PnjMcsoAnykR90bJvo2Eih3DBFWFk5Nq2MU6taX9fSZw56yA ws2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iXra0kI3tMSTcQMi3fDas8dS/Ooc2907ztpP+gA0Npk=; b=rVfkMWgc+GUkfsYUYD94eFzad2+ebBKc7rO1t3Fd1eAJ2WmyqO7QFdYnUz7EI9yCKD HNm69ixMhasmSIwcABWZ1y2s5iCk/V3gSgP2szF165ZS9MN6KCpaVLTGO4beO9AFR5A1 9ueMoUmFgTp3gbl7HW2W/xoSO3wRHK21xLjrnkjTluqaydKlxSfytykiEUMURbjX56GW ROXBiVuRGxIWmtvvPkYDjs9+phYlFBbhEiFKNpxksIEm1eTlTXu7up/5CKPpL+ERjFQd yIctrzETOtb1HJUtLrzlUhaXY884HO9ft1/iRltO8cYxERJ4rzO1+r2hPEatM+yhbhpd fbOg== X-Gm-Message-State: AIkVDXKqfJYWC0cTS51eKHjLz4+vk9xZreNTrhdszgY2oFm2cAdZufbBRJqJui7e7I6KXw== X-Received: by 10.28.217.13 with SMTP id q13mr4819877wmg.13.1484779174109; Wed, 18 Jan 2017 14:39:34 -0800 (PST) Received: from localhost (x4e33e2b8.dyn.telefonica.de. [78.51.226.184]) by smtp.gmail.com with ESMTPSA id r6sm7964339wmd.4.2017.01.18.14.39.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jan 2017 14:39:33 -0800 (PST) From: Artyom Tarasenko To: peter.maydell@linaro.org Date: Wed, 18 Jan 2017 23:38:28 +0100 Message-Id: <1484779123-18968-16-git-send-email-atar4qemu@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1484779123-18968-1-git-send-email-atar4qemu@gmail.com> References: <1484779123-18968-1-git-send-email-atar4qemu@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 15/30] target-sparc: use direct address translation in hyperprivileged mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, Artyom Tarasenko , rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Please note that QEMU doesn't impelement Real->Physical address translation. The "Real Address" is always the "Physical Address". Suggested-by: Richard Henderson Signed-off-by: Artyom Tarasenko --- target/sparc/cpu.h | 7 +++---- target/sparc/translate.c | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 857e93b..53afa18 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -230,7 +230,7 @@ enum { #if !defined(TARGET_SPARC64) #define NB_MMU_MODES 3 #else -#define NB_MMU_MODES 7 +#define NB_MMU_MODES 6 typedef struct trap_state { uint64_t tpc; uint64_t tnpc; @@ -676,8 +676,7 @@ int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc); #define MMU_KERNEL_IDX 2 #define MMU_KERNEL_SECONDARY_IDX 3 #define MMU_NUCLEUS_IDX 4 -#define MMU_HYPV_IDX 5 -#define MMU_PHYS_IDX 6 +#define MMU_PHYS_IDX 5 #else #define MMU_USER_IDX 0 #define MMU_KERNEL_IDX 1 @@ -723,7 +722,7 @@ static inline int cpu_mmu_index(CPUSPARCState *env, bool ifetch) : (env->lsu & DMMU_E) == 0) { return MMU_PHYS_IDX; } else if (cpu_hypervisor_mode(env)) { - return MMU_HYPV_IDX; + return MMU_PHYS_IDX; } else if (env->tl > 0) { return MMU_NUCLEUS_IDX; } else if (cpu_supervisor_mode(env)) { diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 1099976..0f20ed0 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2143,7 +2143,7 @@ static DisasASI get_asi(DisasContext *dc, int insn, TCGMemOp memop) case ASI_NUCLEUS_QUAD_LDD: case ASI_NUCLEUS_QUAD_LDD_L: if (hypervisor(dc)) { - mem_idx = MMU_HYPV_IDX; + mem_idx = MMU_PHYS_IDX; } else { mem_idx = MMU_NUCLEUS_IDX; }