]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target-arm: Add Hyp mode checks to bad_mode_switch()
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 23 Feb 2016 15:36:44 +0000 (15:36 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 26 Feb 2016 15:09:41 +0000 (15:09 +0000)
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

target-arm/helper.c

index 57cc8790c84b7e3714f939942b56aab1e81eec7d..c43d66fd8db5b75ab34a3476f5731e321a1a06b8 100644 (file)
@@ -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: