From patchwork Wed Apr 15 16:02:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 47221 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DD7932121F for ; Wed, 15 Apr 2015 16:08:48 +0000 (UTC) Received: by wiun10 with SMTP id n10sf12648622wiu.1 for ; Wed, 15 Apr 2015 09:08:48 -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=RdEAOGsEe+BCHu7gVB+0X3xGU8CACUDQoYQkUC0OVP4=; b=Jc42f68qJ4HwiF2T3wa7Q7LPaPALID0ba30p/T3g9ezLLa6Mjae2tOGJk64/vrjfmK HqYZ+b3/4slMCPsyJdtKSw0/CSg4x6HhbVeHMsl42cFDS9J6MZI1ohcpfp3qVRB+Fo2F yjhKnfAptBZl+CZAu7ZnB2saTsUD/tG4MrtFMEKi1IOBi4SUqhudBU6qRvoOTKGAMSWM f5uEPVkL1m9Aeg6sij2nh/jnhP4fzlHYySSV2z1II+7siOyst74nzFIFvgVSiunIYuvs o35c0/H/5aF+83WGtu7nnI7/yDHjgII5z62UE4H1unMpcOTPQtErTBFgliWSCogC/gUd 5mig== X-Gm-Message-State: ALoCoQlKaDIC7P5k7R1ne02FSIvrv84YYDARTli6bc/HCLJqVsRaSYH8xCaD2dOJrBzL3oPQPhuS X-Received: by 10.112.219.200 with SMTP id pq8mr4510238lbc.7.1429114128146; Wed, 15 Apr 2015 09:08:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.101 with SMTP id z5ls225762laz.12.gmail; Wed, 15 Apr 2015 09:08:48 -0700 (PDT) X-Received: by 10.112.159.162 with SMTP id xd2mr24024679lbb.67.1429114128003; Wed, 15 Apr 2015 09:08:48 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id bd7si4234747lab.77.2015.04.15.09.08.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2015 09:08:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbzk7 with SMTP id zk7so37901379lbb.0 for ; Wed, 15 Apr 2015 09:08:47 -0700 (PDT) X-Received: by 10.152.23.70 with SMTP id k6mr23960421laf.76.1429114127922; Wed, 15 Apr 2015 09:08:47 -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.67.65 with SMTP id l1csp2609018lbt; Wed, 15 Apr 2015 09:08:47 -0700 (PDT) X-Received: by 10.55.20.141 with SMTP id 13mr53883696qku.30.1429114126694; Wed, 15 Apr 2015 09:08:46 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i40si5061696qkh.103.2015.04.15.09.08.45 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 15 Apr 2015 09:08:46 -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]:32983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YiPro-0002AU-V9 for patch@linaro.org; Wed, 15 Apr 2015 12:08:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YiPmr-00037Y-67 for qemu-devel@nongnu.org; Wed, 15 Apr 2015 12:03:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YiPml-00023j-Ub for qemu-devel@nongnu.org; Wed, 15 Apr 2015 12:03:37 -0400 Received: from mail-oi0-f47.google.com ([209.85.218.47]:33608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YiPml-00023f-Q1 for qemu-devel@nongnu.org; Wed, 15 Apr 2015 12:03:31 -0400 Received: by oica37 with SMTP id a37so26941350oic.0 for ; Wed, 15 Apr 2015 09:03:31 -0700 (PDT) X-Received: by 10.182.227.132 with SMTP id sa4mr21726655obc.40.1429113772497; Wed, 15 Apr 2015 09:02:52 -0700 (PDT) Received: from gbellows-linaro.gateway.pace.com (99-179-1-214.lightspeed.austtx.sbcglobal.net. [99.179.1.214]) by mx.google.com with ESMTPSA id x142sm2567707oie.19.2015.04.15.09.02.50 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 Apr 2015 09:02:51 -0700 (PDT) From: Greg Bellows To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Wed, 15 Apr 2015 11:02:18 -0500 Message-Id: <1429113742-8371-13-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1429113742-8371-1-git-send-email-greg.bellows@linaro.org> References: <1429113742-8371-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.47 Cc: Fabian Aggeler , Greg Bellows Subject: [Qemu-devel] [PATCH v3 12/16] hw/intc/arm_gic: Change behavior of EOIR writes 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.171 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 Grouping (GICv2) and Security Extensions change the behavior of EOIR writes. Completing Group0 interrupts is only allowed from Secure state and completing Group1 interrupts from Secure state is only allowed if AckCtl bit is set. Signed-off-by: Fabian Aggeler Signed-off-by: Greg Bellows --- v1 -> v2 - Fix issue with EOIR writes involving AckCtl. AckCtl is ignored on EOIR group 1 interrupts when non-secure. Group 1 interrupts are only ignored when secure and AckCTl is clear. --- hw/intc/arm_gic.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index d6f8dae..1ba4dfd 100644 --- a/hw/intc/arm_gic.c +++ b/hw/intc/arm_gic.c @@ -384,6 +384,21 @@ void gic_complete_irq(GICState *s, int cpu, int irq) GIC_SET_PENDING(irq, cm); update = 1; } + } else if ((s->revision >= 2 && !s->security_extn) + || (s->security_extn && !ns_access())) { + /* Handle GICv2 without Security Extensions or GIC with Security + * Extensions and a secure write. + */ + if (!GIC_TEST_GROUP0(irq, cm) && !ns_access() + && !(s->cpu_control[cpu][0] & GICC_CTLR_S_ACK_CTL)) { + /* Unpredictable. We choose to ignore. */ + DPRINTF("EOI for Group1 interrupt %d ignored " + "(AckCtl disabled)\n", irq); + return; + } + } else if (s->security_extn && ns_access() && GIC_TEST_GROUP0(irq, cm)) { + DPRINTF("Non-secure EOI for Group0 interrupt %d ignored\n", irq); + return; } if (irq != s->running_irq[cpu]) {