aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorThomas Roth <code@stacksmashing.net>2019-01-29 11:46:03 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-01-29 11:46:03 +0000
commit7e3f122367ec56ea2e8b7313cef82162eb7538c7 (patch)
treebf9f176613d265662260b55806fcf89f004513a6 /target
parent36d820af0eddf4fc6a533579b052d8f0085a9fb8 (diff)
downloadqemu-7e3f122367ec56ea2e8b7313cef82162eb7538c7.zip
qemu-7e3f122367ec56ea2e8b7313cef82162eb7538c7.tar.gz
qemu-7e3f122367ec56ea2e8b7313cef82162eb7538c7.tar.bz2
target/arm: v8m: Ensure IDAU is respected if SAU is disabled
The current behavior of v8m_security_lookup in helper.c only checks whether the IDAU specifies a higher security if the SAU is enabled. If SAU.ALLNS is set to 1, this will lead to addresses being treated as non-secure, even though the IDAU indicates that they must be secure. This patch changes the behavior to also check the IDAU if the SAU is currently disabled. (This brings the behaviour here into line with the v8M Arm ARM SecurityCheck() pseudocode.) Signed-off-by: Thomas Roth <code@stacksmashing.net> Message-id: CAGGekkuc+-tvp5RJP7CM+Jy_hJF7eiRHZ96132sb=hPPCappKg@mail.gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> [PMM: added pseudocode ref to the commit message, fixed comment style] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/arm/helper.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/target/arm/helper.c b/target/arm/helper.c
index e24689f..676059c 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -11078,17 +11078,18 @@ static void v8m_security_lookup(CPUARMState *env, uint32_t address,
}
}
}
+ break;
+ }
- /* The IDAU will override the SAU lookup results if it specifies
- * higher security than the SAU does.
- */
- if (!idau_ns) {
- if (sattrs->ns || (!idau_nsc && sattrs->nsc)) {
- sattrs->ns = false;
- sattrs->nsc = idau_nsc;
- }
+ /*
+ * The IDAU will override the SAU lookup results if it specifies
+ * higher security than the SAU does.
+ */
+ if (!idau_ns) {
+ if (sattrs->ns || (!idau_nsc && sattrs->nsc)) {
+ sattrs->ns = false;
+ sattrs->nsc = idau_nsc;
}
- break;
}
}