From patchwork Sat Jun 14 20:51:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 31903 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B10CF201EF for ; Sat, 14 Jun 2014 20:55:34 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id ma3sf13710316pbc.11 for ; Sat, 14 Jun 2014 13:55:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=FzTBoTOFHqsXFqGUkW34+A/4MFmlawn22VR38NBfIo4=; b=RgJXkAE5b7NXuRh3Nu67jw8I9OBU6IO5VoySiOBWS9/C2MIWjZsJ0maqsOcnLMkkXh mOHD4qH92uBrUkjEh3xvuP9WSjawxCbhdQZGAq4R07ZzzboxP8lISv6ymQWBZwQG333k sUuTN3RicCf6ppRSqc35Z0aesqV3n9ycOnPEnhqGQvo4xHatKeHKUWMw+y5xcyB++FFx 31L3J8Gh6V4sQglny1uiAnofyY3uMEUo67k9a/2ISuP0ChDOv/Sus4GLob7Ng8Cns6LJ J7Bd1IW33GJAM0/nJb5dSZIY2wm5HVOKoL/XOIIQZ4wzl7639sVOIzhLjs97ZZR0I7VN uRCg== X-Gm-Message-State: ALoCoQmDqm10KTuy/uUd/FTAzHy+IF2HpLgBvDxP2yqXiqy3FaFd2ze/SJU+oeBc8OmS9DHUU+nv X-Received: by 10.66.249.68 with SMTP id ys4mr4682235pac.31.1402779333995; Sat, 14 Jun 2014 13:55:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.201 with SMTP id z67ls4138802qgd.94.gmail; Sat, 14 Jun 2014 13:55:33 -0700 (PDT) X-Received: by 10.52.185.39 with SMTP id ez7mr6814785vdc.7.1402779333888; Sat, 14 Jun 2014 13:55:33 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id p7si2609977vdp.5.2014.06.14.13.55.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Jun 2014 13:55:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id jz11so4657746veb.2 for ; Sat, 14 Jun 2014 13:55:33 -0700 (PDT) X-Received: by 10.58.208.228 with SMTP id mh4mr8042978vec.22.1402779333805; Sat, 14 Jun 2014 13:55:33 -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.221.54.6 with SMTP id vs6csp40932vcb; Sat, 14 Jun 2014 13:55:33 -0700 (PDT) X-Received: by 10.229.193.8 with SMTP id ds8mr6954813qcb.10.1402779333407; Sat, 14 Jun 2014 13:55:33 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id v7si8540697qad.84.2014.06.14.13.55.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Jun 2014 13:55:33 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wvuws-0005P8-GQ; Sat, 14 Jun 2014 20:53:14 +0000 Received: from mail-la0-f46.google.com ([209.85.215.46]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WvuvN-0005Ab-Ja for linux-arm-kernel@lists.infradead.org; Sat, 14 Jun 2014 20:51:42 +0000 Received: by mail-la0-f46.google.com with SMTP id gl10so2176375lab.19 for ; Sat, 14 Jun 2014 13:51:19 -0700 (PDT) X-Received: by 10.112.73.234 with SMTP id o10mr6721388lbv.41.1402779079183; Sat, 14 Jun 2014 13:51:19 -0700 (PDT) Received: from localhost.localdomain (x1-6-b8-c7-5d-cb-5a-ca.cpe.webspeed.dk. [2.104.6.253]) by mx.google.com with ESMTPSA id zn1sm4662990lbb.17.2014.06.14.13.51.17 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Jun 2014 13:51:18 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 3/6] arm/arm64: KVM: vgic: Clear queued flags on unqueue Date: Sat, 14 Jun 2014 22:51:04 +0200 Message-Id: <1402779067-34478-4-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1402779067-34478-1-git-send-email-christoffer.dall@linaro.org> References: <1402779067-34478-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140614_135141_823485_FC751A23 X-CRM114-Status: GOOD ( 11.68 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.46 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.46 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Marc Zyngier , Andre Przywara , Christoffer Dall , kvm@vger.kernel.org, Eric Auger X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@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.128.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 If we unqueue a level-triggered interrupt completely, and the LR does not stick around in the active state (and will therefore no longer generate a maintenance interrupt), then we should clear the queued flag so that the vgic can actually queue this level-triggered interrupt at a later time and deal with its pending state then. Note: This should actually be properly fixed to handle the active state on the distributor. Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- virt/kvm/arm/vgic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 00e6bdd..87c977c 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -660,8 +660,10 @@ static void vgic_unqueue_irqs(struct kvm_vcpu *vcpu) * active), then the LR does not hold any useful info and can * be marked as free for other use. */ - if (!(*lr & GICH_LR_STATE)) + if (!(*lr & GICH_LR_STATE)) { vgic_retire_lr(i, irq, vgic_cpu); + vgic_irq_clear_queued(vcpu, irq); + } /* Finally update the VGIC state. */ vgic_update_state(vcpu->kvm);