qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 12/14] target-arm: Add user-mode transaction attribu


From: Peter Maydell
Subject: [Qemu-devel] [PATCH 12/14] target-arm: Add user-mode transaction attribute
Date: Tue, 7 Apr 2015 21:09:58 +0100

Add a transaction attribute indicating that a memory access is being
done from user-mode (unprivileged). This corresponds to an equivalent
signal in ARM AMBA buses.

Signed-off-by: Peter Maydell <address@hidden>
---
 include/exec/memattrs.h | 3 +++
 target-arm/helper.c     | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h
index 5df180e..458c0ea 100644
--- a/include/exec/memattrs.h
+++ b/include/exec/memattrs.h
@@ -27,6 +27,9 @@ typedef uint64_t MemTxAttrs;
 /* ARM/AMBA TrustZone Secure access */
 #define MEMTXATTRS_SECURE (1ULL << 0)
 
+/* Memory access is usermode (unprivileged) */
+#define MEMTXATTRS_USER (1ULL << 1)
+
 /* Bus masters which don't specify any attributes will get this,
  * which has all attribute bits clear except the topmost one
  * (so that we can distinguish "all attributes deliberately clear"
diff --git a/target-arm/helper.c b/target-arm/helper.c
index fdeb2b7..6fca8f8 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -5752,6 +5752,10 @@ static inline int get_phys_addr(CPUARMState *env, 
target_ulong address,
         *attrs = 0;
     }
 
+    if (regime_is_user(env, mmu_idx)) {
+        *attrs |= MEMTXATTRS_USER;
+    }
+
     /* Fast Context Switch Extension. This doesn't exist at all in v8.
      * In v7 and earlier it affects all stage 1 translations.
      */
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]