]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
KVM: arm/arm64: GICv4: Unmap VLPI when freeing an LPI
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 27 Oct 2017 14:28:41 +0000 (15:28 +0100)
committerChristoffer Dall <christoffer.dall@linaro.org>
Fri, 10 Nov 2017 08:29:36 +0000 (09:29 +0100)
When freeing an LPI (on a DISCARD command, for example), we need
to unmap the VLPI down to the physical ITS level.

Acked-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
virt/kvm/arm/vgic/vgic-its.c

index 590f794b73308979d02c83c311985c213107eaf2..ad14af8a44123c05ea0e9400a4bee4817413b497 100644 (file)
@@ -631,8 +631,12 @@ static void its_free_ite(struct kvm *kvm, struct its_ite *ite)
        list_del(&ite->ite_list);
 
        /* This put matches the get in vgic_add_lpi. */
-       if (ite->irq)
+       if (ite->irq) {
+               if (ite->irq->hw)
+                       WARN_ON(its_unmap_vlpi(ite->irq->host_irq));
+
                vgic_put_irq(kvm, ite->irq);
+       }
 
        kfree(ite);
 }