target-arm: reject switching to monitor mode

Reject switching to monitor mode from non-secure state.

Signed-off-by: Sergey Fedorov <s.fedorov@samsung.com>
Signed-off-by: Fabian Aggeler <aggelerf@ethz.ch>
Signed-off-by: Greg Bellows <greg.bellows@linaro.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1413910544-20150-4-git-send-email-greg.bellows@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Sergey Fedorov 2014-10-24 12:19:14 +01:00 committed by Peter Maydell
parent 19e0fefa6f
commit 027fc52704

View File

@ -3531,6 +3531,8 @@ static int bad_mode_switch(CPUARMState *env, int mode)
case ARM_CPU_MODE_IRQ: case ARM_CPU_MODE_IRQ:
case ARM_CPU_MODE_FIQ: case ARM_CPU_MODE_FIQ:
return 0; return 0;
case ARM_CPU_MODE_MON:
return !arm_is_secure(env);
default: default:
return 1; return 1;
} }