linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: christoffer.dall@linaro.org (Christoffer Dall)
To: 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	[thread overview]
Message-ID: <1402779067-34478-4-git-send-email-christoffer.dall@linaro.org> (raw)
In-Reply-To: <1402779067-34478-1-git-send-email-christoffer.dall@linaro.org>

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 <christoffer.dall@linaro.org>
---
 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);
-- 
1.8.5.2

  parent reply	other threads:[~2014-06-14 20:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-14 20:51 [RFC PATCH 0/6] arm/arm64: KVM: Various VGIC cleanups and improvements Christoffer Dall
2014-06-14 20:51 ` [RFC PATCH 1/6] arm/arm64: KVM: Rename irq_state to irq_pending Christoffer Dall
2014-06-18 14:30   ` Eric Auger
2014-06-22 11:20   ` Marc Zyngier
2014-06-14 20:51 ` [RFC PATCH 2/6] arm/arm64: KVM: Rename irq_active to irq_queued Christoffer Dall
2014-06-22 11:25   ` Marc Zyngier
2014-06-30 21:20     ` Christoffer Dall
2014-06-14 20:51 ` Christoffer Dall [this message]
2014-06-22 11:27   ` [RFC PATCH 3/6] arm/arm64: KVM: vgic: Clear queued flags on unqueue Marc Zyngier
2014-06-14 20:51 ` [RFC PATCH 4/6] arm/arm64: KVM: vgic: Improve handling of GICD_I{CS}PENDRn Christoffer Dall
2014-06-18 14:25   ` Eric Auger
2014-07-07 14:39     ` Christoffer Dall
2014-06-14 20:51 ` [RFC PATCH 5/6] arm/arm64: KVM: vgic: Fix SGI writes to GICD_I{CS}PENDR0 Christoffer Dall
2014-06-14 20:51 ` [RFC PATCH 6/6] arm/arm64: KVM: vgic: Clarify and correct vgic documentation Christoffer Dall
2014-06-18 14:47   ` Eric Auger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402779067-34478-4-git-send-email-christoffer.dall@linaro.org \
    --to=christoffer.dall@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).