aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-02-23 15:36:44 +0000
committerPeter Maydell <peter.maydell@linaro.org>2016-02-26 15:09:41 +0000
commite6c8fc07b4fce0729bb747770756835f4b0ca7f4 (patch)
tree32207373dc720e995216f6d7563543155e3a6238
parent52ff951b4f63a29593650a15efdf82f63d6d962d (diff)
target-arm: Add Hyp mode checks to bad_mode_switch()
We don't actually support Hyp mode yet, but add the correct checks for it to the bad_mode_switch() function for completeness. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Sergey Fedorov <serge.fdrv@gmail.com> Message-id: 1455556977-3644-8-git-send-email-peter.maydell@linaro.org
-rw-r--r--target-arm/helper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 57cc8790c8..c43d66fd8d 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -5218,6 +5218,9 @@ static int bad_mode_switch(CPUARMState *env, int mode)
* allows FIQ mode to be Secure-only. (In v8 this doesn't exist.)
*/
return 0;
+ case ARM_CPU_MODE_HYP:
+ 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);
default: