summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Maydell2015-04-26 17:49:25 +0200
committerPeter Maydell2015-04-26 17:49:25 +0200
commitef7bab8d73580b48bda83b8d16b5eea8a3ac43fe (patch)
treef187071a8751a6d419a25b4aee66bbafcc5bd98b
parenttarget-arm: Use attribute info to handle user-only watchpoints (diff)
downloadqemu-ef7bab8d73580b48bda83b8d16b5eea8a3ac43fe.tar.gz
qemu-ef7bab8d73580b48bda83b8d16b5eea8a3ac43fe.tar.xz
qemu-ef7bab8d73580b48bda83b8d16b5eea8a3ac43fe.zip
target-arm: Check watchpoints against CPU security state
Fix a TODO in bp_wp_matches() now that we have a function for testing whether the CPU is currently in Secure mode or not. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
-rw-r--r--target-arm/op_helper.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c
index 4a8c4e000d..3df9c57c91 100644
--- a/target-arm/op_helper.c
+++ b/target-arm/op_helper.c
@@ -600,8 +600,10 @@ static bool bp_wp_matches(ARMCPU *cpu, int n, bool is_wp)
CPUARMState *env = &cpu->env;
uint64_t cr;
int pac, hmc, ssc, wt, lbn;
- /* TODO: check against CPU security state when we implement TrustZone */
- bool is_secure = false;
+ /* Note that for watchpoints the check is against the CPU security
+ * state, not the S/NS attribute on the offending data access.
+ */
+ bool is_secure = arm_is_secure(env);
int access_el = arm_current_el(env);
if (is_wp) {