summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-02-23 15:36:44 +0000
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:46:49 -0600
commit50ea5cf71e22297e5da8a532c7b17b12f9105158 (patch)
tree3556ce031b6af338fa11821a860d5c2717d5b8b0
parentc0ef602ad7103c6a6d1b6d68d498e145cb1895eb (diff)
downloadhqemu-50ea5cf71e22297e5da8a532c7b17b12f9105158.zip
hqemu-50ea5cf71e22297e5da8a532c7b17b12f9105158.tar.gz
target-arm: Forbid mode switch to Mon from Secure EL1
In v8 trying to switch mode to Mon from Secure EL1 is an illegal mode switch. (In v7 this is impossible as all secure modes except User are at EL3.) We can handle this case by making a switch to Mon valid only if the current EL is 3, which then gives the correct answer whether EL3 is AArch32 or AArch64. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Sergey Fedorov <serge.fdrv@gmail.com> Message-id: 1455556977-3644-9-git-send-email-peter.maydell@linaro.org
-rw-r--r--target-arm/helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target-arm/helper.c b/target-arm/helper.c
index e22cca4..2aed46c 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -5225,7 +5225,7 @@ static int bad_mode_switch(CPUARMState *env, int mode)
return !arm_feature(env, ARM_FEATURE_EL2)
|| arm_current_el(env) < 2 || arm_is_secure(env);
case ARM_CPU_MODE_MON:
- return !arm_is_secure(env);
+ return arm_current_el(env) < 3;
default:
return 1;
}
OpenPOWER on IntegriCloud