From patchwork Mon Jun 9 15:04:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 357522 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B84F414007B for ; Tue, 10 Jun 2014 01:13:35 +1000 (EST) Received: from localhost ([::1]:33774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu1GP-0003Vm-DM for incoming@patchwork.ozlabs.org; Mon, 09 Jun 2014 11:13:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu1Fv-0002l4-S4 for qemu-devel@nongnu.org; Mon, 09 Jun 2014 11:13:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wu1Fq-00039I-D3 for qemu-devel@nongnu.org; Mon, 09 Jun 2014 11:13:03 -0400 Received: from mail-qg0-x236.google.com ([2607:f8b0:400d:c04::236]:44033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu1Fq-00039E-97 for qemu-devel@nongnu.org; Mon, 09 Jun 2014 11:12:58 -0400 Received: by mail-qg0-f54.google.com with SMTP id q108so9058260qgd.13 for ; Mon, 09 Jun 2014 08:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=ySWoQyja2QqwAfG/hlnnaHPykrzigYLXCn3RvA2tRf8=; b=1FgB12cR6liRCOGd6u/BJ3W2i4MpwONBcRbLLgETkmcpPHZXy4RVwT+NhsNtY2Btsg X3G7+a83lhvXOS+It0JVQElM131bhrlmSeFQ72sUtZ3Y6cqqb4kkmUvVT7YmFdZidVoS 8dbGA63+tVu/J3jrYjtdeNEtBRYLKHAwmV2objLBovXAguZVVIl4GpeWBbISgD0ksDDx yTM+1ja6InAaSM6RJt2C0H4QICzeLOgMPfShZpvBXBAv/daegOOY8VyiJ9VrEfLnXQG3 ckuQBG4+iIFfiEb28QwTuRbrb3usWDBMqV+p2qt++AuwVx0HqD4UQJmTudAHYxdq1mDh dWhQ== X-Received: by 10.140.92.200 with SMTP id b66mr30847381qge.41.1402326777942; Mon, 09 Jun 2014 08:12:57 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id l10sm30868439qae.41.2014.06.09.08.12.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Jun 2014 08:12:57 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 10 Jun 2014 01:04:23 +1000 Message-Id: <1402326269-8573-12-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1402326269-8573-1-git-send-email-edgar.iglesias@gmail.com> References: <1402326269-8573-1-git-send-email-edgar.iglesias@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c04::236 Cc: rob.herring@linaro.org, peter.crosthwaite@xilinx.com, aggelerf@ethz.ch, agraf@suse.de, blauwirbel@gmail.com, john.williams@xilinx.com, greg.bellows@linaro.org, pbonzini@redhat.com, alex.bennee@linaro.org, christoffer.dall@linaro.org, rth@twiddle.net Subject: [Qemu-devel] [PATCH v2 11/17] target-arm: Don't take interrupts targeting lower ELs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Reviewed-by: Alex Bennée Signed-off-by: Edgar E. Iglesias Reviewed-by: Greg Bellows --- target-arm/cpu.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 2f262a5..6aed57c 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -1129,6 +1129,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: