From patchwork Mon May 19 09:23: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: 350196 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 CFA7F14008B for ; Mon, 19 May 2014 19:39:22 +1000 (EST) Received: from localhost ([::1]:46939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmK2S-0001oQ-QV for incoming@patchwork.ozlabs.org; Mon, 19 May 2014 05:39:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmK1q-0000gr-5k for qemu-devel@nongnu.org; Mon, 19 May 2014 05:38:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WmK1h-0001lN-5U for qemu-devel@nongnu.org; Mon, 19 May 2014 05:38:42 -0400 Received: from mail-wg0-x22a.google.com ([2a00:1450:400c:c00::22a]:57175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmK1g-0001lA-Uy for qemu-devel@nongnu.org; Mon, 19 May 2014 05:38:33 -0400 Received: by mail-wg0-f42.google.com with SMTP id y10so7466491wgg.25 for ; Mon, 19 May 2014 02:38:29 -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=qOf4JqX9tWoMU2A/CAvqyJcXmA5BvORxPoFHHrATGwg=; b=pKlP5Lpz8jgrioFM/GCBXiPhmqY1vOlThEsSYHfYLQvpY6RS9Nizpf4981lB4K3F4q MME6eI+uSnPaFnXEx02C8CE4mKbnCKxzdTybqrpDN5Te4F7rVc07dyv3FoHtEVMUAKt3 vsucmFaOtPuFtzBYZUwcf8I3rsK8OuhuB1DObms0UzYVLabYxtj3vHw8FG83lF7V1boK t1SE6j2tiOMEkN7xO6ZAjc+yMLzFStJm+X9akjbNZrvCol2Q7ivAaH8kxzTt9sOUPS9C 0WfTiccC6iIdw3YgN7KKQVzehT9dzYutUQc6aWqAVnO7c+E+nrYSTT1rrPWB5okorbFr eNLA== X-Received: by 10.180.211.239 with SMTP id nf15mr11874959wic.9.1400492308955; Mon, 19 May 2014 02:38:28 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id fu10sm14095096wib.11.2014.05.19.02.38.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 19 May 2014 02:38:28 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Mon, 19 May 2014 19:23:03 +1000 Message-Id: <1400491383-6725-23-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1400491383-6725-1-git-send-email-edgar.iglesias@gmail.com> References: <1400491383-6725-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: 2a00:1450:400c:c00::22a 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 v3 22/22] RFC: 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 | 26 ++++---------------------- target-arm/translate.h | 2 +- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 566f9ed..3b7ef32 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -1084,32 +1084,14 @@ 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 - -static inline int arm_el_to_mmu_idx(int current_el) -{ -#ifdef CONFIG_USER_ONLY - return MMU_USER_IDX; -#else - switch (current_el) { - case 0: - return MMU_USER_IDX; - case 1: - return 0; - default: - /* Unsupported EL. */ - assert(0); - return 0; - } -#endif -} +#define MMU_MODE0_SUFFIX _user +#define MMU_MODE1_SUFFIX _kernel +#define MMU_USER_IDX 0 static inline int cpu_mmu_index (CPUARMState *env) { int cur_el = arm_current_pl(env); - return arm_el_to_mmu_idx(cur_el); + return cur_el; } #include "exec/cpu-all.h" diff --git a/target-arm/translate.h b/target-arm/translate.h index db6f0af..31a0104 100644 --- a/target-arm/translate.h +++ b/target-arm/translate.h @@ -54,7 +54,7 @@ static inline int arm_dc_feature(DisasContext *dc, int feature) static inline int get_mem_index(DisasContext *s) { - return arm_el_to_mmu_idx(s->current_pl); + return s->current_pl; } /* target-specific extra values for is_jmp */