From patchwork Mon Sep 29 18:26:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 38097 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C3335201F1 for ; Mon, 29 Sep 2014 18:32:37 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id b57sf9040003eek.10 for ; Mon, 29 Sep 2014 11:32:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=gg+njTsGNxHgl3L3VuurMWfkx6KNIvCDv4MxOqsykTc=; b=WexxePN6AQTEV/gql4G8kwI7AE+5o0I3AmsY9WQ9+1ZXQs0bLzAUbIzAj8eboRh0wg i/Pp66C9DvjhURQzWh3dIiLOxsGTGzRdOlr17x7zWtv5L6qek1KZaH6EyNOHYZvpEbqm RfuhZ6B72H3hN6pycRx/sbdTfIDT5Sz4Y/k3Pv58OD9g59cqeYYV1yC2KtA+P3skNCY5 Qj/0KXu9bKAywSAJUiIZfVhs8NsPriFUBrrBESq2iHH8geg9NLmtepqD04Yk23U9uiG4 Z6kBI8JBoAdEYy5x+DQWqVzP7Mamd/U46gnJT2EbhTqou99O4LDS59Hn6MEgSBdTbkzg 6xow== X-Gm-Message-State: ALoCoQlaAuYfLelCUTPmfqE2LrWUOYsMeLoPTodAdXYU000WCHBViLA+5/akCHm9WfeLR1M6QGbH X-Received: by 10.181.23.197 with SMTP id ic5mr3280197wid.7.1412015556923; Mon, 29 Sep 2014 11:32:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.173 with SMTP id j13ls405742lab.82.gmail; Mon, 29 Sep 2014 11:32:36 -0700 (PDT) X-Received: by 10.152.25.129 with SMTP id c1mr42346605lag.14.1412015556674; Mon, 29 Sep 2014 11:32:36 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx.google.com with ESMTPS id x9si12810042lbb.28.2014.09.29.11.32.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Sep 2014 11:32:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id f15so5039007lbj.11 for ; Mon, 29 Sep 2014 11:32:36 -0700 (PDT) X-Received: by 10.112.163.103 with SMTP id yh7mr39213018lbb.73.1412015556503; Mon, 29 Sep 2014 11:32:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp225145lbb; Mon, 29 Sep 2014 11:32:35 -0700 (PDT) X-Received: by 10.229.249.8 with SMTP id mi8mr52023299qcb.6.1412015555181; Mon, 29 Sep 2014 11:32:35 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z5si14394167qcg.43.2014.09.29.11.32.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 29 Sep 2014 11:32:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:38350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYfkQ-0008Gp-Cl for patch@linaro.org; Mon, 29 Sep 2014 14:32:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYffF-0008IC-DR for qemu-devel@nongnu.org; Mon, 29 Sep 2014 14:27:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYffA-0007WM-BT for qemu-devel@nongnu.org; Mon, 29 Sep 2014 14:27:13 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:54082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYffA-0007L2-5A for qemu-devel@nongnu.org; Mon, 29 Sep 2014 14:27:08 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1XYfew-0005of-Cy for qemu-devel@nongnu.org; Mon, 29 Sep 2014 19:26:54 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 29 Sep 2014 19:26:47 +0100 Message-Id: <1412015213-22268-14-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1412015213-22268-1-git-send-email-peter.maydell@linaro.org> References: <1412015213-22268-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 13/19] 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: "Edgar E. Iglesias" Reviewed-by: Alex Bennée Reviewed-by: Greg Bellows Reviewed-by: Peter Maydell Signed-off-by: Edgar E. Iglesias Message-id: 1411718914-6608-6-git-send-email-edgar.iglesias@gmail.com Signed-off-by: Peter Maydell --- target-arm/cpu.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index cc2c210..81e7e81 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: