mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-09 10:30:48 -07:00
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
This commit is contained in:
parent
e6c8fc07b4
commit
58ae2d1f03
1 changed files with 1 additions and 1 deletions
|
|
@ -5222,7 +5222,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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue