From 027fc52704b815bd67a92399d255f066308ca70c Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 24 Oct 2014 12:19:14 +0100 Subject: [PATCH] target-arm: reject switching to monitor mode Reject switching to monitor mode from non-secure state. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler Signed-off-by: Greg Bellows Reviewed-by: Edgar E. Iglesias Reviewed-by: Peter Maydell Message-id: 1413910544-20150-4-git-send-email-greg.bellows@linaro.org Signed-off-by: Peter Maydell --- target-arm/helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index 53527c2003..f5d6e68186 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -3531,6 +3531,8 @@ static int bad_mode_switch(CPUARMState *env, int mode) case ARM_CPU_MODE_IRQ: case ARM_CPU_MODE_FIQ: return 0; + case ARM_CPU_MODE_MON: + return !arm_is_secure(env); default: return 1; }