From patchwork Wed Nov 5 23:22:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 40230 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 082C4240A6 for ; Wed, 5 Nov 2014 23:28:50 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id ex7sf1482157wid.0 for ; Wed, 05 Nov 2014 15:28:50 -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: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=WygOHmxA4KSTDDs/e2hrIbEfHUF4BZvWgeA3pD0lXNg=; b=SuaCdjzmrtZCig+7PpfOwAmAseUJvtU65Tya8nUoz3es+nI9sihef4JmLGTbmuoQxh A1xOp51okVex5cZo4ij77Ci6ceUeJukm4cs8QAFbS4u9G6zXLUbJEMTnEpzKaUdIf6wa q2L8lkoR5iGnxlbkCLtDuja12jdo675jR9cKR8ExfrCUVbdmmKS/rgVEI9/uXR0oqN3o 6HK2gZOVXDLqWPWT4PWUFPdwsZsoGSejrxImmT6uLrRQjLSyrxMB6auwcr0kvK2FjpJ/ YBtmCQ1N0XMHctqYMURlmidAgk8qdGn7w0bCTw3idfOO/ZMzJ/k+gwmgam71ABWmDQJ9 HqTw== X-Gm-Message-State: ALoCoQmN9WUXMdxShd9ee/iTZwyQgZuEal2KAyYEEmJ8em6OE7Fe7ril5LU19cO/JxX41s1xo7Ij X-Received: by 10.112.145.200 with SMTP id sw8mr87997lbb.4.1415230130178; Wed, 05 Nov 2014 15:28:50 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.169 with SMTP id r9ls8085laj.57.gmail; Wed, 05 Nov 2014 15:28:49 -0800 (PST) X-Received: by 10.152.43.97 with SMTP id v1mr570688lal.3.1415230129949; Wed, 05 Nov 2014 15:28:49 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id j9si8703186lag.75.2014.11.05.15.28.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Nov 2014 15:28:49 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id ge10so1639343lab.30 for ; Wed, 05 Nov 2014 15:28:49 -0800 (PST) X-Received: by 10.112.77.74 with SMTP id q10mr626584lbw.66.1415230129789; Wed, 05 Nov 2014 15:28:49 -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.184.201 with SMTP id ew9csp371713lbc; Wed, 5 Nov 2014 15:28:49 -0800 (PST) X-Received: by 10.224.66.7 with SMTP id l7mr757995qai.71.1415230128556; Wed, 05 Nov 2014 15:28:48 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v10si5254179qab.80.2014.11.05.15.28.48 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 05 Nov 2014 15:28:48 -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]:48987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmA0N-0003vC-MQ for patch@linaro.org; Wed, 05 Nov 2014 18:28:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xm9vR-0004AB-0c for qemu-devel@nongnu.org; Wed, 05 Nov 2014 18:23:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xm9vL-0004cs-EL for qemu-devel@nongnu.org; Wed, 05 Nov 2014 18:23:40 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:63983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xm9vL-0004cl-99 for qemu-devel@nongnu.org; Wed, 05 Nov 2014 18:23:35 -0500 Received: by mail-pd0-f169.google.com with SMTP id y10so1679656pdj.28 for ; Wed, 05 Nov 2014 15:23:34 -0800 (PST) X-Received: by 10.68.250.196 with SMTP id ze4mr621856pbc.2.1415229814756; Wed, 05 Nov 2014 15:23:34 -0800 (PST) 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 r4sm4086349pdm.93.2014.11.05.15.23.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Nov 2014 15:23:33 -0800 (PST) From: Greg Bellows To: qemu-devel@nongnu.org, serge.fdrv@gmail.com, edgar.iglesias@gmail.com, aggelerf@ethz.ch, peter.maydell@linaro.org Date: Wed, 5 Nov 2014 17:22:56 -0600 Message-Id: <1415229793-3278-10-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1415229793-3278-1-git-send-email-greg.bellows@linaro.org> References: <1415229793-3278-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: greg.bellows@linaro.org Subject: [Qemu-devel] [PATCH v9 09/26] 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.43 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 1be185d..3086c2c 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: