summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@xilinx.com>2014-09-29 18:48:49 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-09-29 18:48:49 +0100
commitdfafd0908820acf68f7c69ab3e0ebe855278d0bb (patch)
treefc8462f82a5dd1478423d34e59c2c8d699b1c0ab
parent043b7f8d12dc922172cf7d570dc2854dbf81dcb3 (diff)
downloadqemu-dfafd0908820acf68f7c69ab3e0ebe855278d0bb.zip
target-arm: Don't take interrupts targeting lower ELs
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>
-rw-r--r--target-arm/cpu.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index cc2c2100b3..81e7e814c1 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -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: