From patchwork Fri Sep 26 13:16:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 37980 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 83831202DB for ; Fri, 26 Sep 2014 13:23:24 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id n15sf1581349lbi.3 for ; Fri, 26 Sep 2014 06:23:23 -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=HI30TTAQcGqxtDl5aqzZ4/mw0FIaHEgXWpjL9p9Kyms=; b=ah/Jpmdh9NoqZTY1/x/8JG0Sv2Ph8bSv1v45B7zqGliDfImBRs8J+2QseRhfyesI7S bLBmiMkMETYcOCvX7YTh04wvxTLzOLj1Z7nABBj1mRVyXSA4T74jFYb+VrDsJeFs+Gqr vv+DVNqsyv7jm4o2ZKcHQZfLF3KZXpTEgE4Kn0Rk0fYRJbcz76O9QV1PK0iFWt7hNrYO uGJChTAvxBi1W30sD4pXl0cqcW+zvWyj/xcj59i17srE9sVEeriFn9fnV7xTxTsvc/gr Jm7E0fyzjMAj1t2kcfj/YlsiWbnvj3X+HWfi3oziUh25yjmBezjn9N17qm6RWxVwVg3W +rEA== X-Gm-Message-State: ALoCoQlcNxgiDXdsgNZ9eoaKc7tThUTfXRwhfP3h8HRclVB65QNCxRVNyYmFhuXHtLm7GyN1iIlw X-Received: by 10.194.100.3 with SMTP id eu3mr19366wjb.6.1411737803345; Fri, 26 Sep 2014 06:23:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.5 with SMTP id m5ls399479laj.81.gmail; Fri, 26 Sep 2014 06:23:23 -0700 (PDT) X-Received: by 10.152.206.101 with SMTP id ln5mr20464052lac.46.1411737803188; Fri, 26 Sep 2014 06:23:23 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx.google.com with ESMTPS id rc5si7106006lac.118.2014.09.26.06.23.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Sep 2014 06:23:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id ty20so1992775lab.13 for ; Fri, 26 Sep 2014 06:23:22 -0700 (PDT) X-Received: by 10.112.200.134 with SMTP id js6mr19221289lbc.0.1411737802868; Fri, 26 Sep 2014 06:23:22 -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.130.169 with SMTP id of9csp59749lbb; Fri, 26 Sep 2014 06:23:21 -0700 (PDT) X-Received: by 10.66.189.131 with SMTP id gi3mr30737238pac.114.1411737801144; Fri, 26 Sep 2014 06:23:21 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ok10si9119257pbb.219.2014.09.26.06.23.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Sep 2014 06:23:21 -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 1XXVT6-0007tl-2a; Fri, 26 Sep 2014 13:21:52 +0000 Received: from mail-la0-f44.google.com ([209.85.215.44]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XXVPj-0002md-Id for linux-arm-kernel@lists.infradead.org; Fri, 26 Sep 2014 13:18:24 +0000 Received: by mail-la0-f44.google.com with SMTP id gi9so4207110lab.31 for ; Fri, 26 Sep 2014 06:17:58 -0700 (PDT) X-Received: by 10.112.130.41 with SMTP id ob9mr19152255lbb.12.1411737478149; Fri, 26 Sep 2014 06:17:58 -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 z4sm1876657laz.39.2014.09.26.06.17.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Sep 2014 06:17:57 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , Gleb Natapov Subject: [PATCH 13/27] arm/arm64: KVM: vgic: Clear queued flags on unqueue Date: Fri, 26 Sep 2014 15:16:46 +0200 Message-Id: <1411737420-9063-14-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1411737420-9063-1-git-send-email-christoffer.dall@linaro.org> References: <1411737420-9063-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140926_061823_806092_681BE758 X-CRM114-Status: GOOD ( 11.39 ) 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.44 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.44 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: linux-arm-kernel@lists.infradead.org, Christoffer Dall , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.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+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.215.54 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. 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 ce1a2d1..2026b61 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -667,8 +667,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);