From patchwork Thu Jul 10 14:39:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 4524301 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 27DAA9F37C for ; Thu, 10 Jul 2014 14:42:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45C6520218 for ; Thu, 10 Jul 2014 14:42: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 67F1A2015E for ; Thu, 10 Jul 2014 14:42: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 1X5FWN-0002WM-M1; Thu, 10 Jul 2014 14:40:27 +0000 Received: from mail-la0-f47.google.com ([209.85.215.47]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X5FW7-0001HJ-Kp for linux-arm-kernel@lists.infradead.org; Thu, 10 Jul 2014 14:40:12 +0000 Received: by mail-la0-f47.google.com with SMTP id s18so6302325lam.34 for ; Thu, 10 Jul 2014 07:39:46 -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=7P7fLBd2qogN+cKs7h4EgIDjqixv194PZDfRUYh/UqI=; b=DCT+BvvgF87PlqhMfKZjV2WyhOUGJVhUfEve9ka+P31e9Hmn9a7ZIvfrZxIuh8EtLi DmF1UbtUVF3uE8NRszZEooN2UsM4pazR07eZXQ+ck4PCO6ovOTKReEHlzbtixVFEYxeo Pf+dad2Y+XeAwnsKBSbrrBjKyfdYdOJutPn+KPFgKypAUT4to0ARH4d/9avTwAWo7P74 WP2vI1bO1hoz2mwBr5+bJJTtSf5cXhJgwELaQ88yvNCiEjpkND76ALcKa1t2MVu/A8uO t4YTlBYOwlR2LfuE17mUkoeAkcJEtd0LUcDHvro4IA7bbq86Gxpw3nSeMcGui2hP3eRd h3sg== X-Gm-Message-State: ALoCoQnhF8SrZGAPYLm5TwfCg53xbMCXRcLf+gDErr2g2aOwLvv8hRxk1boejD1vEZTKk8k0qnTt X-Received: by 10.112.171.134 with SMTP id au6mr5680301lbc.21.1405003186163; Thu, 10 Jul 2014 07:39:46 -0700 (PDT) Received: from localhost.localdomain (188-178-240-98-static.dk.customer.tdc.net. [188.178.240.98]) by mx.google.com with ESMTPSA id k3sm21663774lam.4.2014.07.10.07.39.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 07:39:45 -0700 (PDT) From: Christoffer Dall To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH 3/6] arm/arm64: KVM: vgic: Clear queued flags on unqueue Date: Thu, 10 Jul 2014 07:39:53 -0700 Message-Id: <1405003196-12403-4-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1405003196-12403-1-git-send-email-christoffer.dall@linaro.org> References: <1405003196-12403-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140710_074011_886010_190DA5CF X-CRM114-Status: GOOD ( 11.20 ) X-Spam-Score: -0.7 (/) Cc: Marc Zyngier , Christoffer Dall , eric.auger@linaro.org 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.6 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. Acked-by: Marc Zyngier Signed-off-by: Christoffer Dall --- 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 c5b1ad7..1b85f42 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -662,8 +662,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.state & LR_STATE_MASK)) + if (!(lr.state & LR_STATE_MASK)) { vgic_retire_lr(i, lr.irq, vcpu); + vgic_irq_clear_queued(vcpu, lr.irq); + } /* Finally update the VGIC state. */ vgic_update_state(vcpu->kvm);