From patchwork Sun May 25 01:08:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 352195 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D7CCE140085 for ; Sun, 25 May 2014 11:14:01 +1000 (EST) Received: from localhost ([::1]:49868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoN0h-0000Dv-Ph for incoming@patchwork.ozlabs.org; Sat, 24 May 2014 21:13:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoMzt-0007fw-GL for qemu-devel@nongnu.org; Sat, 24 May 2014 21:13:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WoMzk-00050E-FX for qemu-devel@nongnu.org; Sat, 24 May 2014 21:13:09 -0400 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]:54157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoMzk-000503-8c for qemu-devel@nongnu.org; Sat, 24 May 2014 21:13:00 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb1so5825038pad.23 for ; Sat, 24 May 2014 18:12:59 -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; bh=wOYUhAYbuCX/zzxBDIjG4XDD+IttCD/+Q77wUd8lpZo=; b=K/YuMO0M9MaaJrzRvvfnK6oMVtg2e2RzmCVzQFAP++IhjF7+Xm9Oth5doRbjEMJkzh fw3x1jmmpvP8lDA3HCw3/GEEVRaVh/WYx+mcgr5+jJW3G0E/hiBH90rXazNqibJKDU9J q0PBzpepP2AA+Y7drZstqiL4hA8v1HDWITrIbISogTNpQmQ+zGpT2Yo5VrTmKlS0PpQh +ppMN7kszE8i2Twl5ey2alUKmAz+HNuPCaNYPwmiCJJX7yXfReH67hf8wXOZA4BslprJ SX3U3n7cpRcucthvwh2K/B690CJekPGXhObVDi1EQkei1P/67lZgMZYiovEV6WCV006m ggeQ== X-Received: by 10.68.164.4 with SMTP id ym4mr17152759pbb.53.1400980379128; Sat, 24 May 2014 18:12:59 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id ja8sm11290525pbd.3.2014.05.24.18.12.52 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 24 May 2014 18:12:58 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Sun, 25 May 2014 11:08:34 +1000 Message-Id: <1400980132-25949-6-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1400980132-25949-1-git-send-email-edgar.iglesias@gmail.com> References: <1400980132-25949-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::232 Cc: rob.herring@linaro.org, peter.crosthwaite@xilinx.com, aggelerf@ethz.ch, agraf@suse.de, john.williams@xilinx.com, greg.bellows@linaro.org, alex.bennee@linaro.org, christoffer.dall@linaro.org, rth@twiddle.net Subject: [Qemu-devel] [PATCH v5 05/23] target-arm: Use a 1:1 mapping between EL and MMU index X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias Message-id: 1400805738-11889-7-git-send-email-edgar.iglesias@gmail.com --- target-arm/cpu.h | 8 ++++---- target-arm/translate.h | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index c83f249..5aa978d 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -1080,12 +1080,12 @@ static inline CPUARMState *cpu_init(const char *cpu_model) #define cpu_list arm_cpu_list /* MMU modes definitions */ -#define MMU_MODE0_SUFFIX _kernel -#define MMU_MODE1_SUFFIX _user -#define MMU_USER_IDX 1 +#define MMU_MODE0_SUFFIX _user +#define MMU_MODE1_SUFFIX _kernel +#define MMU_USER_IDX 0 static inline int cpu_mmu_index (CPUARMState *env) { - return arm_current_pl(env) ? 0 : 1; + return arm_current_pl(env); } #include "exec/cpu-all.h" diff --git a/target-arm/translate.h b/target-arm/translate.h index 8737af0..31a0104 100644 --- a/target-arm/translate.h +++ b/target-arm/translate.h @@ -54,11 +54,7 @@ static inline int arm_dc_feature(DisasContext *dc, int feature) static inline int get_mem_index(DisasContext *s) { -#ifdef CONFIG_USER_ONLY - return 1; -#else - return s->user; -#endif + return s->current_pl; } /* target-specific extra values for is_jmp */