@@ -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"
@@ -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.
*/
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 <peter.maydell@linaro.org> --- include/exec/memattrs.h | 3 +++ target-arm/helper.c | 4 ++++ 2 files changed, 7 insertions(+)