From patchwork Fri Oct 10 16:03: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: 38613 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 64837205D8 for ; Fri, 10 Oct 2014 16:16:27 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id q1sf2356904lam.8 for ; Fri, 10 Oct 2014 09:16:25 -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: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=JVYaAXiKHvZJ71QJ1qXQzqsPmK0ZEI7d0LK+6fHKK6s=; b=B9d2yZ4Dojw02Lz3M2XGVHPTC/Q3JewiFDeHVNVJ96CZhWT0Jyn2iPvegV/Eq3shdu a7ma+DPN+0oxIfejJgt0f2hb2YSqWEn1HbgSg5cvIfhnREIY+/RekA7kvOKdYWcqxgXy IA2wY2bFrPA/B7HS1il65eyT0HanHu+wHrREOZoKbxX96bVBwkpjAAN7DZZyBVVDCMVu rmErwELJqZZP69bsuZqM1dh2bONMGmbqKa90Jz0FUwmh5Bjr7cjQNzoNTmj/fnrPQG2l fp8ajRErrORqqgWYd3uMXYq+B+AAOmMmaI2zCcjRZ9N/Adlx3EWJPa9OWvIApnKbGt5u cyfg== X-Gm-Message-State: ALoCoQlfzQkif18HQg0HntnACw3AX1MG+4EoxW79WF29nadwuXIxbsurqr6mfsHunDPPPXDrwaXH X-Received: by 10.152.43.66 with SMTP id u2mr1185090lal.1.1412957785907; Fri, 10 Oct 2014 09:16:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.132 with SMTP id c4ls272564lac.88.gmail; Fri, 10 Oct 2014 09:16:25 -0700 (PDT) X-Received: by 10.152.37.135 with SMTP id y7mr6031680laj.66.1412957785771; Fri, 10 Oct 2014 09:16:25 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com [209.85.215.52]) by mx.google.com with ESMTPS id kf3si9998767lbc.68.2014.10.10.09.16.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 09:16:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id hz20so3666255lab.11 for ; Fri, 10 Oct 2014 09:16:23 -0700 (PDT) X-Received: by 10.112.156.227 with SMTP id wh3mr5749943lbb.23.1412957783071; Fri, 10 Oct 2014 09:16:23 -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 c5csp458002lbz; Fri, 10 Oct 2014 09:16:22 -0700 (PDT) X-Received: by 10.140.36.167 with SMTP id p36mr9668399qgp.61.1412957781715; Fri, 10 Oct 2014 09:16:21 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id m7si13045478qag.0.2014.10.10.09.16.21 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 10 Oct 2014 09:16:21 -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]:49514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xccrc-00011Z-Ob for patch@linaro.org; Fri, 10 Oct 2014 12:16:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xccfw-00074P-G3 for qemu-devel@nongnu.org; Fri, 10 Oct 2014 12:04:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xccfp-000840-Qc for qemu-devel@nongnu.org; Fri, 10 Oct 2014 12:04:16 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:34857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xccfp-00083o-NC for qemu-devel@nongnu.org; Fri, 10 Oct 2014 12:04:09 -0400 Received: by mail-oi0-f48.google.com with SMTP id g201so7087225oib.35 for ; Fri, 10 Oct 2014 09:04:09 -0700 (PDT) X-Received: by 10.202.76.213 with SMTP id z204mr2785470oia.76.1412957049381; Fri, 10 Oct 2014 09:04:09 -0700 (PDT) Received: from gbellows-linaro.bellowshome.net (99-179-1-128.lightspeed.austtx.sbcglobal.net. [99.179.1.128]) by mx.google.com with ESMTPSA id d6sm5382455obt.12.2014.10.10.09.04.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 09:04:08 -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: Fri, 10 Oct 2014 11:03:26 -0500 Message-Id: <1412957023-11105-16-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1412957023-11105-1-git-send-email-greg.bellows@linaro.org> References: <1412957023-11105-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.218.48 Subject: [Qemu-devel] [PATCH v6 15/32] 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.52 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 a831b40..760e3f9 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -4211,12 +4211,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: