]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: arm/arm64: vgic: Don't notify EOI for non-SPIs
authorMarc Zyngier <marc.zyngier@arm.com>
Wed, 23 Nov 2016 10:11:21 +0000 (10:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2016 06:16:19 +0000 (07:16 +0100)
commit 8ca18eec2b2276b449c1dc86b98bf083c5fe4e09 upstream.

When we inject a level triggerered interrupt (and unless it
is backed by the physical distributor - timer style), we request
a maintenance interrupt. Part of the processing for that interrupt
is to feed to the rest of KVM (and to the eventfd subsystem) the
information that the interrupt has been EOIed.

But that notification only makes sense for SPIs, and not PPIs
(such as the PMU interrupt). Skip over the notification if
the interrupt is not an SPI.

Fixes: 140b086dd197 ("KVM: arm/arm64: vgic-new: Add GICv2 world switch backend")
Fixes: 59529f69f504 ("KVM: arm/arm64: vgic-new: Add GICv3 world switch backend")
Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
virt/kvm/arm/vgic/vgic-v2.c
virt/kvm/arm/vgic/vgic-v3.c

index 0bf6709d1006c4bc5d148d4a3164d31b0ac96ecd..6fb4314cec494d06d57ad230555ea6b981c7db10 100644 (file)
@@ -50,8 +50,10 @@ void vgic_v2_process_maintenance(struct kvm_vcpu *vcpu)
 
                        WARN_ON(cpuif->vgic_lr[lr] & GICH_LR_STATE);
 
-                       kvm_notify_acked_irq(vcpu->kvm, 0,
-                                            intid - VGIC_NR_PRIVATE_IRQS);
+                       /* Only SPIs require notification */
+                       if (vgic_valid_spi(vcpu->kvm, intid))
+                               kvm_notify_acked_irq(vcpu->kvm, 0,
+                                                    intid - VGIC_NR_PRIVATE_IRQS);
                }
        }
 
index 9f0dae397d9c818b1d0237076d0bc59020a05950..5c9f9745e6cab8284161397c3d810df65304fae8 100644 (file)
@@ -41,8 +41,10 @@ void vgic_v3_process_maintenance(struct kvm_vcpu *vcpu)
 
                        WARN_ON(cpuif->vgic_lr[lr] & ICH_LR_STATE);
 
-                       kvm_notify_acked_irq(vcpu->kvm, 0,
-                                            intid - VGIC_NR_PRIVATE_IRQS);
+                       /* Only SPIs require notification */
+                       if (vgic_valid_spi(vcpu->kvm, intid))
+                               kvm_notify_acked_irq(vcpu->kvm, 0,
+                                                    intid - VGIC_NR_PRIVATE_IRQS);
                }
 
                /*