From patchwork Tue Sep 30 21:49:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 38203 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CCE922032C for ; Tue, 30 Sep 2014 22:04:18 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf497422wib.5 for ; Tue, 30 Sep 2014 15:04:18 -0700 (PDT) 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:cc: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=YO5nJSOXajD1zbI8hmYaTkRA2i4mGhVkYdWYbcZCYOU=; b=aHnOKu019elHSkCYUZLuWV4ybc4OMYymT4qp3ZRKspMlp44CHMwKFOOt1XBRZrTm21 9bJ4feJ3cfkNowWF3Da+5lOf/W2BOyyXb5JjGS5hNoa31BdJ1drZHbM7XREW9DbBkUDG 3Wz9tIcFUoK6jkdrqQ1FD+eLMIDCNdJ041DihrygLCZTcEr/BTc2xGILZYzpBbmLdb4L NzdXEyW06CnUOVdC5v2JoDcc7uCq8AwqL0PZ0oYPlxoxDasMPfuwV4kqOILnXlC04hgi OHp+qj8/6d2utG2Pm6PZ+Bec7dvZ49A6ES4/HY4AyWGB4PZdlRk+KW+XBW6233Hvkbzr FUaA== X-Gm-Message-State: ALoCoQmdHXtFwfug1wDWLvRYFr4MJIvHNx1BScDw/r8OZHowd0sbeJvNJNTRJYluh2Ia/i41jaed X-Received: by 10.152.42.229 with SMTP id r5mr3043lal.8.1412114658009; Tue, 30 Sep 2014 15:04:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.194 with SMTP id a2ls97665lak.41.gmail; Tue, 30 Sep 2014 15:04:17 -0700 (PDT) X-Received: by 10.112.13.132 with SMTP id h4mr47734347lbc.45.1412114657871; Tue, 30 Sep 2014 15:04:17 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by mx.google.com with ESMTPS id p14si24653465lal.6.2014.09.30.15.04.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Sep 2014 15:04:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id w7so4138676lbi.23 for ; Tue, 30 Sep 2014 15:04:17 -0700 (PDT) X-Received: by 10.152.45.1 with SMTP id i1mr546634lam.56.1412114657794; Tue, 30 Sep 2014 15:04:17 -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 of9csp430753lbb; Tue, 30 Sep 2014 15:04:17 -0700 (PDT) X-Received: by 10.224.4.72 with SMTP id 8mr23895207qaq.79.1412114656482; Tue, 30 Sep 2014 15:04:16 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id j93si11160377qgj.43.2014.09.30.15.04.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 30 Sep 2014 15:04:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:46642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ5Wp-0005aH-JC for patch@linaro.org; Tue, 30 Sep 2014 18:04:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ5JO-0000cn-LP for qemu-devel@nongnu.org; Tue, 30 Sep 2014 17:50:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZ5JJ-0003s6-La for qemu-devel@nongnu.org; Tue, 30 Sep 2014 17:50:22 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:52909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ5JI-0003qQ-MX for qemu-devel@nongnu.org; Tue, 30 Sep 2014 17:50:17 -0400 Received: by mail-pd0-f169.google.com with SMTP id p10so7906144pdj.28 for ; Tue, 30 Sep 2014 14:50:15 -0700 (PDT) X-Received: by 10.68.96.4 with SMTP id do4mr73834118pbb.44.1412113815302; Tue, 30 Sep 2014 14:50:15 -0700 (PDT) Received: from gbellows-linaro.qualcomm.com (rrcs-67-52-129-61.west.biz.rr.com. [67.52.129.61]) by mx.google.com with ESMTPSA id qy1sm16027662pbc.27.2014.09.30.14.50.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Sep 2014 14:50:14 -0700 (PDT) From: Greg Bellows To: qemu-devel@nongnu.org, peter.maydell@linaro.org, serge.fdrv@gmail.com, edgar.iglesias@gmail.com, aggelerf@ethz.ch Date: Tue, 30 Sep 2014 16:49:26 -0500 Message-Id: <1412113785-21525-15-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1412113785-21525-1-git-send-email-greg.bellows@linaro.org> References: <1412113785-21525-1-git-send-email-greg.bellows@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.169 Cc: Sergey Fedorov , Greg Bellows Subject: [Qemu-devel] [PATCH v5 14/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: greg.bellows@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.178 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 --- target-arm/helper.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index cb2eb3c..8cc94ce 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -4213,12 +4213,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: