From patchwork Fri Nov 4 20:50:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9413221 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 BD61160573 for ; Fri, 4 Nov 2016 21:05:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFCB62AF10 for ; Fri, 4 Nov 2016 21:05:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A489C2AF6F; Fri, 4 Nov 2016 21:05:27 +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 22DCF2AF10 for ; Fri, 4 Nov 2016 21:05:27 +0000 (UTC) Received: from localhost ([::1]:40773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2lfy-00041c-Br for patchwork-qemu-devel@patchwork.kernel.org; Fri, 04 Nov 2016 17:05:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2lSd-00010p-Fw for qemu-devel@nongnu.org; Fri, 04 Nov 2016 16:51:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2lSa-00049A-Dq for qemu-devel@nongnu.org; Fri, 04 Nov 2016 16:51:39 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:34131) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2lSa-00047b-8C for qemu-devel@nongnu.org; Fri, 04 Nov 2016 16:51:36 -0400 Received: by mail-wm0-x243.google.com with SMTP id p190so5635216wmp.1 for ; Fri, 04 Nov 2016 13:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=ke4kw9uzq82swunV6XbNrWsgme6K0rBAu675NedOi3o=; b=pbOjXeO7NDSPIbpESyA2TPV5bEkRi/86CZfEW0F/8C+2x2KNIj4zfpCz66O8IXbm8F U2RgKFE14KnV9uEB4ijtqtEbGIZzb3R2ufyNFrD0MBYBK7llc17XZrLwxfCrpy6mI7ar rdTKdIMZ9BoF5KQR7HA8DFzc4dCaJEYHt5FAo1gv6+uV0e/M0lQN2gW7dLdUGrehcK9i Y7XJ+fymu46+EYKEil353Y6Fy9XsrZfTRdR6yUg4aGRvuDgyc//3p39GNo9riwz2TcCE sZB60eD24BhO4k5awfujLD2a/O5KxAWMwFrmBR+ApAXSKX+TRL+k6E7QpWA7PWzVxWkK zt3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=ke4kw9uzq82swunV6XbNrWsgme6K0rBAu675NedOi3o=; b=c4q+GWGPH+E/0TZ8s5jF8ofRu4syZvsMT1GHtlq8pvhqs60fCBs5SZ1/BCD9kj0KPR 3YAs9Xw7SfmyYUxRQlGEmHSoKs9vzTWdscsw/ztWT7AgeRL9JU8BCYeec1l67Vj/PUz4 qIqSg8V5cxFjr4mkc/6mCUADBPVfTUUvZ1YATEIK+wbbdnCORo9wh2+dc0Fa7kTWerq1 PE5JK9CYDsq9DlIVglNRP05BQxKRQphC7LKR3uox3MOrCqWbjgtdZyvXc5d+3T3d8TGF gadVsVafsKeRQfWGg6cc4Q9CNzEXoO7BdHlqz7PDVm+2ZbulhLJjIFKwUuZ6M6ryt9X1 T4Cw== X-Gm-Message-State: ABUngvfBwDqy+Su8mB5x3OoKuLvC75LL1MItu17nvQa5Or02IBSpJCutc6iB2wOQrPbE8g== X-Received: by 10.194.189.83 with SMTP id gg19mr13375139wjc.165.1478292694942; Fri, 04 Nov 2016 13:51:34 -0700 (PDT) Received: from localhost (x55b4b5cf.dyn.telefonica.de. [85.180.181.207]) by smtp.gmail.com with ESMTPSA id n6sm16119834wjg.30.2016.11.04.13.51.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Nov 2016 13:51:34 -0700 (PDT) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Fri, 4 Nov 2016 21:50:16 +0100 Message-Id: X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH v1 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 , Artyom Tarasenko , Richard Henderson 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 6c1607e..6fc81e8 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; @@ -673,8 +673,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 @@ -720,7 +719,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 23d4673..53c327d 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; }