From patchwork Sat Sep 13 04:29:19 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: 388864 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 55070140114 for ; Sat, 13 Sep 2014 14:40:18 +1000 (EST) Received: from localhost ([::1]:48402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSf8C-0006LM-DF for incoming@patchwork.ozlabs.org; Sat, 13 Sep 2014 00:40:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSf4b-0008OS-3E for qemu-devel@nongnu.org; Sat, 13 Sep 2014 00:36:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSf4W-0006QO-5r for qemu-devel@nongnu.org; Sat, 13 Sep 2014 00:36:33 -0400 Received: from mail-qg0-x234.google.com ([2607:f8b0:400d:c04::234]:59161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSf4W-0006QJ-1J for qemu-devel@nongnu.org; Sat, 13 Sep 2014 00:36:28 -0400 Received: by mail-qg0-f52.google.com with SMTP id i50so1774358qgf.39 for ; Fri, 12 Sep 2014 21:36:27 -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=1u4yANcy2lHjATf7hLyFjviyzwbe7k9jTFIlvULW+ZE=; b=LOJDiOd5R63f0XRBSZGLVvJLdM4xhb9OBrciwsHkP/Sm+l48Km3G7czAR3RdVlJqai A0y28AB/0+qJA2T164p00OZOoFMmNKbC7pE8ak2oQqDQlYAxIMQqt0n8+ppLWkiZFrh0 WMT/6FZNR2MT3Zz2jpJ3JzeNPeib1cOu90SwhsKcttua2RyxdU823ZDOKTGN3JCoGSlG 2wtaaHnVxmHzyvFGekZOutmmvgbJxTrmC3AFXzVoLelYbUp8/Dt5N5eUgiTV4xn3DvJP dxObunNZJFGwQRwNCRS9EkbrooJhZ972J+UNeimpTVILaFelLc9tY21M7EyGpeDxS6cE X96g== X-Received: by 10.140.40.84 with SMTP id w78mr19401668qgw.87.1410582987628; Fri, 12 Sep 2014 21:36:27 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id v10sm1088715qar.10.2014.09.12.21.36.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 12 Sep 2014 21:36:26 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Sat, 13 Sep 2014 14:29:19 +1000 Message-Id: <1410582564-27687-6-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1410582564-27687-1-git-send-email-edgar.iglesias@gmail.com> References: <1410582564-27687-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::234 Cc: rob.herring@linaro.org, peter.crosthwaite@xilinx.com, aggelerf@ethz.ch, agraf@suse.de, greg.bellows@linaro.org, pbonzini@redhat.com, alex.bennee@linaro.org, christoffer.dall@linaro.org, rth@twiddle.net Subject: [Qemu-devel] [PATCH v6 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 a5e8e0d..7f8a410 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -1174,6 +1174,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: