From patchwork Wed Jan 11 20:19:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 9511231 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 DD0C96075C for ; Wed, 11 Jan 2017 20:41:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE0F4285FD for ; Wed, 11 Jan 2017 20:41:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C319E2865F; Wed, 11 Jan 2017 20:41:54 +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 471B8285FD for ; Wed, 11 Jan 2017 20:41:54 +0000 (UTC) Received: from localhost ([::1]:56954 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRPiT-0002u7-9h for patchwork-qemu-devel@patchwork.kernel.org; Wed, 11 Jan 2017 15:41:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRPOI-0006gi-IY for qemu-devel@nongnu.org; Wed, 11 Jan 2017 15:21:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRPOH-00016T-Mi for qemu-devel@nongnu.org; Wed, 11 Jan 2017 15:21:02 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:34055) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cRPOH-00015y-Ga for qemu-devel@nongnu.org; Wed, 11 Jan 2017 15:21:01 -0500 Received: by mail-wm0-x241.google.com with SMTP id c85so576261wmi.1 for ; Wed, 11 Jan 2017 12:21:01 -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 :in-reply-to:references; bh=Csnr3iokk784pmiwRNv6DCb+d1b+pdL6oWdq4A3m1T0=; b=gLCYFIcAB5Hi/7NZ0E9663DjCS6I7CP4ae0qMg2Y8BQaApMQibTjBwz7R3DzNvXdJb s8vAT22OZo0PGMkhsARZSobAUF3vwFxj+sGlbDYRXsDe0LOnRjMLHFu4Y04b+bADaSxJ zIA45NRoggw+PZGgbC9IzxqR7u9stoKXK+Elln70Y0JtsafjEGjdBpeG+ZTPKWgY7zTf idzxteHHXns240XwPMNtWbGhfjB2Lci2evaHnX2W1M5ldSoLiq86njNEdnEncrCSevWl hoYQurVGyU1YJcFpgzcjQ9C+trsEOeR5ox9156fkKWWS67Dra4fuoEQ+t2cZeXD5UZim 5WIQ== 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:in-reply-to:references; bh=Csnr3iokk784pmiwRNv6DCb+d1b+pdL6oWdq4A3m1T0=; b=Zosw8H+t8g2ohuWDwxHL8Frp1i0SvoEdKPDV03/6Sm+CKGiHkD26sanICwKnqA09oJ f02DtM8bt7prC0EZpOeVl7tJLMdgk7qnQFRoM5xGg3RPdkG3wSZeLohpBeqaqPQQaeF/ 7T4Zff4v2kyYxV/n6hzVqC2VL+V3KvGtCnK1hRPGOK/bQB5sSzBK3jsY2fwSkoDxwQNp WLzM1cwGFAIrix2DvvM0dAGIWXphdXs6nDlMHZcaEM+fM4BXKKC0xI2F6n4MfIvaoilU cEPD9MRv7oYsNC1QRfpAHboAs3ejWYawAiJF1lEWqygTReoCshrqRgAW+Gm6OsglbVKp LqJA== X-Gm-Message-State: AIkVDXJLPYM8rIP3CCTX4f6o6Rrc7IqiLqp/oe0j5uphb//sSlYffhwCp/Nre2k//3lYvA== X-Received: by 10.223.151.138 with SMTP id s10mr4894408wrb.65.1484166060566; Wed, 11 Jan 2017 12:21:00 -0800 (PST) Received: from localhost (x55b4b54a.dyn.telefonica.de. [85.180.181.74]) by smtp.gmail.com with ESMTPSA id s20sm31519688wmb.9.2017.01.11.12.20.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 12:20:59 -0800 (PST) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Wed, 11 Jan 2017 21:19:46 +0100 Message-Id: <1965259f2b94c607929f7b70158a100bfd1c2f83.1484165352.git.atar4qemu@gmail.com> 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::241 Subject: [Qemu-devel] [PATCH v2 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; }