]> xenbits.xensource.com Git - qemu-upstream-unstable.git/commitdiff
target-arm: Don't take interrupts targeting lower ELs
authorEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Mon, 29 Sep 2014 17:48:49 +0000 (18:48 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 29 Sep 2014 17:48:49 +0000 (18:48 +0100)
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Greg Bellows <greg.bellows@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 1411718914-6608-6-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target-arm/cpu.h

index cc2c2100b3f6b0987373369342545f5e5cc2a0af..81e7e814c1c12915f9713c37dd5f42f44a6e98b7 100644 (file)
@@ -1175,6 +1175,13 @@ bool write_cpustate_to_list(ARMCPU *cpu);
 static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx)
 {
     CPUARMState *env = cs->env_ptr;
+    unsigned int cur_el = arm_current_pl(env);
+    unsigned int target_el = arm_excp_target_el(cs, excp_idx);
+
+    /* Don't take exceptions if they target a lower EL.  */
+    if (cur_el > target_el) {
+        return false;
+    }
 
     switch (excp_idx) {
     case EXCP_FIQ: