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: 4353481 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 73984BEEAA for ; Sat, 14 Jun 2014 20:56:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B53F4201F4 for ; Sat, 14 Jun 2014 20:56:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2B9320121 for ; Sat, 14 Jun 2014 20:56:17 +0000 (UTC) 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sJYpzHF/D+Ya0pmT3FPrLfG7JYDIg89AU/xqTDZemPY=; b=BenK3wEFKJ8LbmA/JynflwSH5mvIjCqXpz+OmdLMMF+QfESq2LpHAfJUCJH1/eba/J d5jhDGF3QJoUz4Z8CafeDIfIO2jwrjx5K966xnlv+90neB0S9ElRJvnsZWDsgM0Nt2k7 jOIAgqyDK6fc5Q3s5sfTC3BB+X29Ms6VpAw8WPGs2qkQhi3QnFHjv4cT7APaOIjqEd4e LXKa4kHj0LaVfPvWkCn/IfDNqtxCujgED8cTggO75bED3vzbdewSPJm033xCeXCQK4RG MXDnTZ2MV03YEXlqmknv3lv7EfGWkV+qMUC3WjQxFwvGt5QfQsDvacafK7C+N/TVobVK UdYg== X-Gm-Message-State: ALoCoQlBYtJiYFmqYODCKAZyyV2dp2AHUgFZK4Q1A1Vc68OdRaXeik2CoYn0rd5sBVxchljJH6z5 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 (/) 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);