From patchwork Fri May 23 00:42:03 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: 351674 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 7EC36140082 for ; Fri, 23 May 2014 10:47:49 +1000 (EST) Received: from localhost ([::1]:40276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WndeF-0005cc-Gp for incoming@patchwork.ozlabs.org; Thu, 22 May 2014 20:47:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wnddh-0004xQ-Ix for qemu-devel@nongnu.org; Thu, 22 May 2014 20:47:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnddY-0006ia-Iz for qemu-devel@nongnu.org; Thu, 22 May 2014 20:47:13 -0400 Received: from mail-qc0-x22d.google.com ([2607:f8b0:400d:c01::22d]:48937) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnddY-0006iW-D2 for qemu-devel@nongnu.org; Thu, 22 May 2014 20:47:04 -0400 Received: by mail-qc0-f173.google.com with SMTP id i8so7040414qcq.32 for ; Thu, 22 May 2014 17:47:04 -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=A0CSiFSA/Gq7GmAVEc9q+D+L37U+MSzu7S1Q6CYm39Q=; b=nzgXrOCgrMMQ4KZ0TPDDhpkC7pEaJ6zjQb798QodvjvJGWrdvhUnJzv96rpltG5EdK RXmZfDuxFuetgtPT6eK7k1tP5zuQk/9KRcgiCHTkFer0V54Y/2QH0TTMcZ4k37MqVtw0 iY6WOS8OdZchfcDAv48xU5lqCVoVtIphP6LOoLYWt7Ah8z74/paGXYTWJ5cvDcF5mIgF YH3ElbA118SZr+4a6HL90H/KLePu6gNeF1xHax9J00EGzQpKHiIwNK50rpgma2mxti2W 0E92YfFkKA5E0kuY8mdL/2Zp0wMD63nbGmZHyJaKE9xBOv2TiJpltx85mh6Gz9zOoxVg z4Gw== X-Received: by 10.140.90.69 with SMTP id w63mr1814069qgd.52.1400806023969; Thu, 22 May 2014 17:47:03 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id j53sm931353qge.36.2014.05.22.17.46.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 22 May 2014 17:47:03 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 23 May 2014 10:42:03 +1000 Message-Id: <1400805738-11889-7-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1400805738-11889-1-git-send-email-edgar.iglesias@gmail.com> References: <1400805738-11889-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:400d:c01::22d Cc: rob.herring@linaro.org, peter.crosthwaite@xilinx.com, aggelerf@ethz.ch, agraf@suse.de, john.williams@xilinx.com, alex.bennee@linaro.org, christoffer.dall@linaro.org, rth@twiddle.net Subject: [Qemu-devel] [PATCH v4 06/21] 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 --- 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 11b7a0b..62d85ff 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 */