From patchwork Thu Oct 30 21:28:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 39927 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3782D2405B for ; Fri, 31 Oct 2014 16:03:09 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id p9sf500212lbv.5 for ; Fri, 31 Oct 2014 09:03:08 -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=Jo6EbOWcTR9diUp+OJMgLSMyu5LWmFmR/PWmKrsdWm8=; b=mO9b1bgcf9DoyQT1plUhME1oun09uXq+OwZn5tcW8oIZ4D9auRzr9wdxCttGdQMkph MRdtGE+DzaleO0qwEQ12NxWZtdkeUzBFq9ktk6S2GE2PS2J2bwD+XLjdyiEpxp0wbjNZ LJ9F8TlT2NlXYwUGmTopwfXYENV7k28zsz+gx3CozNf9R9qDYK5mrOn3H5I5BJL1L2o7 sj0tSPv9Dmj0ZlSXu78qIxr8s4QQQHih/o2nATZ2ZMCgl8GcMlri4TpwZdKha81JjPGM vDDJ4SnKw/5BIqHF8gDNmBgT34rlYfbjayXsEfHIa9zwBkybwpevqjdJwoGt5QwK6+GT 6SDg== X-Gm-Message-State: ALoCoQnVBnRKlzrJRHB/qcVD1Q+gIEtj/DNsVCTkcP1oe8diugmVf/Jp/jF7hl2qM1TTY0q81LBg X-Received: by 10.194.242.36 with SMTP id wn4mr607984wjc.4.1414771387982; Fri, 31 Oct 2014 09:03:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.80 with SMTP id be16ls492557lab.107.gmail; Fri, 31 Oct 2014 09:03:07 -0700 (PDT) X-Received: by 10.112.239.12 with SMTP id vo12mr27541078lbc.81.1414771387577; Fri, 31 Oct 2014 09:03:07 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id is3si17454834lac.11.2014.10.31.09.03.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 09:03:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id gq15so6541928lab.15 for ; Fri, 31 Oct 2014 09:03:07 -0700 (PDT) X-Received: by 10.113.6.1 with SMTP id cq1mr5968208lbd.32.1414771387113; Fri, 31 Oct 2014 09:03:07 -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.84.229 with SMTP id c5csp224766lbz; Fri, 31 Oct 2014 09:03:00 -0700 (PDT) X-Received: by 10.224.129.133 with SMTP id o5mr29712503qas.104.1414771379919; Fri, 31 Oct 2014 09:02:59 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y9si17770307qab.10.2014.10.31.09.02.59 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 31 Oct 2014 09:02:59 -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]:38602 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkEfD-0005hi-2A for patch@linaro.org; Fri, 31 Oct 2014 12:02:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkE66-0004VX-NF for qemu-devel@nongnu.org; Fri, 31 Oct 2014 11:28:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjxHW-0004oS-Fv for qemu-devel@nongnu.org; Thu, 30 Oct 2014 17:29:27 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:65294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjxHW-0004nY-9x for qemu-devel@nongnu.org; Thu, 30 Oct 2014 17:29:22 -0400 Received: by mail-pd0-f179.google.com with SMTP id g10so5923493pdj.38 for ; Thu, 30 Oct 2014 14:29:21 -0700 (PDT) X-Received: by 10.70.5.227 with SMTP id v3mr5031491pdv.165.1414704561609; Thu, 30 Oct 2014 14:29:21 -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 o5sm8017713pdr.50.2014.10.30.14.29.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Oct 2014 14:29:20 -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: Thu, 30 Oct 2014 16:28:40 -0500 Message-Id: <1414704538-17103-10-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1414704538-17103-1-git-send-email-greg.bellows@linaro.org> References: <1414704538-17103-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.179 Cc: greg.bellows@linaro.org Subject: [Qemu-devel] [PATCH v8 09/27] 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.215.42 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 --- target-arm/helper.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index 3fdd3c2..e73756d 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -4227,12 +4227,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: