Patchwork [7/7] target-arm: Translate with user-state from TB flags, not CPUState

login
register
mail settings
Submitter Peter Maydell
Date Jan. 7, 2011, 3:06 p.m.
Message ID <1294412794-25573-8-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/77883/
State New
Headers show

Comments

Peter Maydell - Jan. 7, 2011, 3:06 p.m.
When translating, get the user/priv state from the TB flags, not
the CPUState.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/translate.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 7d042ee..289501d 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -9078,11 +9078,7 @@  static inline void gen_intermediate_code_internal(CPUState *env,
     dc->condexec_mask = (tb->flags & 0xf00) >> 7;
     dc->condexec_cond = (tb->flags & 0xf000) >> 12;
 #if !defined(CONFIG_USER_ONLY)
-    if (IS_M(env)) {
-        dc->user = ((env->v7m.exception == 0) && (env->v7m.control & 1));
-    } else {
-        dc->user = (env->uncached_cpsr & 0x1f) == ARM_CPU_MODE_USR;
-    }
+    dc->user = ((tb->flags & (1 << 6)) == 0);
 #endif
     dc->vfp_enabled = ((tb->flags & (1 << 7)) != 0);
     dc->vec_len = (tb->flags >> 1) & 7;