From patchwork Thu Dec 11 12:19:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 42137 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 D49C226C6D for ; Thu, 11 Dec 2014 12:32:40 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id c13sf3626010eek.10 for ; Thu, 11 Dec 2014 04:32:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references: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; bh=3rt2+wA5aRF88j2cLf/0CYMXB1v0r8zCkaFTos02ITI=; b=k6dZxGNGWXw7uF/DwDyLm+8m3UTVpgkftXmVCQ/aFYEdn3Cin+VD1Jg4FX392LX1cL sQ7pGWCBIlhEbi6Q4Af6b+LLvGhOkh2oNVvlHi3AEHKC53nN+L4ymjvfMGB+eNKWQmH1 2ZE/FyGOHZAiXhMhs3+Idk/stZTjjTn7w0mhZsBwy22Y6bVMNLZozAaioGCtqAnNJV3t ZyA7Q/2c/97D9xeJLSEvBZ10U1+e7At4B7qhJOZRUwi0/helgj5YRFRkqn5LwRN9Ak6y pnRquAD6tlFAbEYsGm+v0LGN9CjFDTpWOL3e10x9jP+qxNOg2AUjh5Xf/gn2nJnaPVvv e8VA== X-Gm-Message-State: ALoCoQkFwBfF2xLOtISMlIShHUeoTXDGXqvtYquibStplinqob6v+Suz/eRPAyVlJ9tM5jz0kJJd X-Received: by 10.112.14.2 with SMTP id l2mr1623961lbc.5.1418301160146; Thu, 11 Dec 2014 04:32:40 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.9 with SMTP id o9ls304773lao.83.gmail; Thu, 11 Dec 2014 04:32:39 -0800 (PST) X-Received: by 10.112.85.11 with SMTP id d11mr9588478lbz.100.1418301159911; Thu, 11 Dec 2014 04:32:39 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id j15si1181106lbg.30.2014.12.11.04.32.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Dec 2014 04:32:39 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id p9so3953672lbv.7 for ; Thu, 11 Dec 2014 04:32:39 -0800 (PST) X-Received: by 10.152.7.229 with SMTP id m5mr9700658laa.80.1418301159795; Thu, 11 Dec 2014 04:32:39 -0800 (PST) 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.142.69 with SMTP id ru5csp506770lbb; Thu, 11 Dec 2014 04:32:39 -0800 (PST) X-Received: by 10.224.88.8 with SMTP id y8mr18553947qal.47.1418301158262; Thu, 11 Dec 2014 04:32:38 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g75si1028447qge.83.2014.12.11.04.32.37 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Dec 2014 04:32:38 -0800 (PST) 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]:50627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz2v7-0008Lu-7p for patch@linaro.org; Thu, 11 Dec 2014 07:32:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz2j6-00054R-JE for qemu-devel@nongnu.org; Thu, 11 Dec 2014 07:20:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xz2j5-0007US-BF for qemu-devel@nongnu.org; Thu, 11 Dec 2014 07:20:12 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:54567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz2j5-0006sg-4i for qemu-devel@nongnu.org; Thu, 11 Dec 2014 07:20:11 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Xz2ip-00019T-Sh for qemu-devel@nongnu.org; Thu, 11 Dec 2014 12:19:55 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 11 Dec 2014 12:19:33 +0000 Message-Id: <1418300395-4348-12-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1418300395-4348-1-git-send-email-peter.maydell@linaro.org> References: <1418300395-4348-1-git-send-email-peter.maydell@linaro.org> 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 11/33] target-arm: implement IRQ/FIQ routing to Monitor mode 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.176 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: Fabian Aggeler SCR.{IRQ/FIQ} bits allow to route IRQ/FIQ exceptions to monitor CPU mode. When taking IRQ exception to monitor mode FIQ exception is additionally masked. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler Signed-off-by: Greg Bellows Reviewed-by: Peter Maydell Message-id: 1416242878-876-10-git-send-email-greg.bellows@linaro.org Signed-off-by: Peter Maydell --- target-arm/helper.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index d3180dd..973b5a9 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -4233,12 +4233,21 @@ void arm_cpu_do_interrupt(CPUState *cs) /* Disable IRQ and imprecise data aborts. */ mask = CPSR_A | CPSR_I; offset = 4; + if (env->cp15.scr_el3 & SCR_IRQ) { + /* IRQ routed to monitor mode */ + new_mode = ARM_CPU_MODE_MON; + mask |= CPSR_F; + } break; case EXCP_FIQ: new_mode = ARM_CPU_MODE_FIQ; addr = 0x1c; /* Disable FIQ, IRQ and imprecise data aborts. */ mask = CPSR_A | CPSR_I | CPSR_F; + if (env->cp15.scr_el3 & SCR_FIQ) { + /* FIQ routed to monitor mode */ + new_mode = ARM_CPU_MODE_MON; + } offset = 4; break; case EXCP_SMC: