From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEaXk-0000Ep-Lw for qemu-devel@nongnu.org; Tue, 05 Aug 2014 04:56:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEaXf-0005uV-NJ for qemu-devel@nongnu.org; Tue, 05 Aug 2014 04:56:28 -0400 Received: from mail-pd0-x22e.google.com ([2607:f8b0:400e:c02::22e]:33289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEaXf-0005uI-GQ for qemu-devel@nongnu.org; Tue, 05 Aug 2014 04:56:23 -0400 Received: by mail-pd0-f174.google.com with SMTP id fp1so979276pdb.19 for ; Tue, 05 Aug 2014 01:56:22 -0700 (PDT) From: "Edgar E. Iglesias" Date: Tue, 5 Aug 2014 18:49:59 +1000 Message-Id: <1407228605-27081-6-git-send-email-edgar.iglesias@gmail.com> In-Reply-To: <1407228605-27081-1-git-send-email-edgar.iglesias@gmail.com> References: <1407228605-27081-1-git-send-email-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v4 05/10] target-arm: Don't take interrupts targeting lower ELs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: rob.herring@linaro.org, peter.crosthwaite@xilinx.com, aggelerf@ethz.ch, agraf@suse.de, blauwirbel@gmail.com, greg.bellows@linaro.org, pbonzini@redhat.com, alex.bennee@linaro.org, christoffer.dall@linaro.org, rth@twiddle.net From: "Edgar E. Iglesias" Reviewed-by: Alex Bennée Reviewed-by: Greg Bellows Reviewed-by: Peter Maydell Signed-off-by: Edgar E. Iglesias --- target-arm/cpu.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 63fdcbf..5a62032 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -1148,6 +1148,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: -- 1.9.1