qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>,
	peter.crosthwaite@xilinx.com, patches@linaro.org,
	aggelerf@ethz.ch, alex.bennee@linaro.org, rth@twiddle.net
Subject: [Qemu-devel] [PATCH 5/5] target-arm: Use a 1:1 mapping between EL and MMU index
Date: Fri, 23 May 2014 16:31:42 +0100	[thread overview]
Message-ID: <1400859102-15779-6-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1400859102-15779-1-git-send-email-peter.maydell@linaro.org>

From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
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 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 */
-- 
1.9.2

      parent reply	other threads:[~2014-05-23 15:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 15:31 [Qemu-devel] [PATCH 0/5] mmu index cleanup/fixes Peter Maydell
2014-05-23 15:31 ` [Qemu-devel] [PATCH 1/5] target-arm: Move get_mem_index to translate.h Peter Maydell
2014-05-23 15:31 ` [Qemu-devel] [PATCH 2/5] target-arm/translate.c: Clean up mmu index handling for ldrt/strt Peter Maydell
2014-05-23 15:31 ` [Qemu-devel] [PATCH 3/5] target-arm/translate.c: Use get_mem_index() for SRS memory accesses Peter Maydell
2014-05-23 15:31 ` [Qemu-devel] [PATCH 4/5] target-arm: A32: Use get_mem_index for load/stores Peter Maydell
2014-05-23 15:31 ` Peter Maydell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1400859102-15779-6-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=aggelerf@ethz.ch \
    --cc=alex.bennee@linaro.org \
    --cc=edgar.iglesias@xilinx.com \
    --cc=patches@linaro.org \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).