From patchwork Mon Aug 18 09:40:25 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: 380933 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 D904814009B for ; Mon, 18 Aug 2014 19:47:37 +1000 (EST) Received: from localhost ([::1]:42660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJJXL-0005Tw-TQ for incoming@patchwork.ozlabs.org; Mon, 18 Aug 2014 05:47:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJJWu-0004pG-GQ for qemu-devel@nongnu.org; Mon, 18 Aug 2014 05:47:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJJWp-0007N9-Mm for qemu-devel@nongnu.org; Mon, 18 Aug 2014 05:47:08 -0400 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]:35991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJJWp-0007N5-G8 for qemu-devel@nongnu.org; Mon, 18 Aug 2014 05:47:03 -0400 Received: by mail-pa0-f48.google.com with SMTP id et14so7368365pad.21 for ; Mon, 18 Aug 2014 02:46:59 -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=rIFWMZJBnOgWd0jmV5q0GpS2ovqZ+7/lexIhfDs/TAc=; b=eXiI0utdcAHz+Yyv8gElL0QciDQD9xg0T2yYRXYBjm+WEK8QqGS66mOanjShjTWAU1 B1M+JNRuH2VfswXjuEndiUmtcO6Abq0jH5U8mLrX3bwC+HpsSqctJHZH9y68UilHNhbY uNZ1oLzWXlxeL9jjZbfaU8182jqa58KnLyzW8SOuiNwU7yIKY55M4bTVJFwnbX3q4EiU LbZcPG0dXJYPjGLqVlpkAA3zCqYE6uZW+VrtAglyE3auDcwx/n1LpYMFZ1UZs/txoSZD U/vO4fbXTm27gXScDm6BjnemrY1YsCtyaoOfUilOlryHK9+YVju4FqFhlNx9tVyXKfhy d+6g== X-Received: by 10.70.35.15 with SMTP id d15mr40106714pdj.48.1408355219100; Mon, 18 Aug 2014 02:46:59 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id nh16sm24059054pdb.9.2014.08.18.02.46.53 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 18 Aug 2014 02:46:58 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Mon, 18 Aug 2014 19:40:25 +1000 Message-Id: <1408354830-1143-6-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408354830-1143-1-git-send-email-edgar.iglesias@gmail.com> References: <1408354830-1143-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:400e:c03::230 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 Subject: [Qemu-devel] [PATCH v5 05/10] 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 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 ffcfb10..dd39642 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -1149,6 +1149,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: