[Qemu-devel] [PATCH 1/2] target/arm: Always return ARMASIdx_NS when num_ases == 1

Richard Henderson posted 2 patches 7 years, 7 months ago
[Qemu-devel] [PATCH 1/2] target/arm: Always return ARMASIdx_NS when num_ases == 1
Posted by Richard Henderson 7 years, 7 months ago
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index e310ffc29d..c26cc43ea8 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -2915,7 +2915,7 @@ enum {
 /* Return the address space index to use for a memory access */
 static inline int arm_asidx_from_attrs(CPUState *cs, MemTxAttrs attrs)
 {
-    return attrs.secure ? ARMASIdx_S : ARMASIdx_NS;
+    return cs->num_ases > 1 && attrs.secure ? ARMASIdx_S : ARMASIdx_NS;
 }
 
 /* Return the AddressSpace to use for a memory access
-- 
2.17.1