Skip to content

Commit 8ca18ee

Browse files
author
Marc Zyngier
committed
KVM: arm/arm64: vgic: Don't notify EOI for non-SPIs
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. Cc: stable@vger.kernel.org # 4.7+ Fixes: 140b086 ("KVM: arm/arm64: vgic-new: Add GICv2 world switch backend") Fixes: 59529f6 ("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>
1 parent b112c84 commit 8ca18ee

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

virt/kvm/arm/vgic/vgic-v2.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ void vgic_v2_process_maintenance(struct kvm_vcpu *vcpu)
5050

5151
WARN_ON(cpuif->vgic_lr[lr] & GICH_LR_STATE);
5252

53-
kvm_notify_acked_irq(vcpu->kvm, 0,
54-
intid - VGIC_NR_PRIVATE_IRQS);
53+
/* Only SPIs require notification */
54+
if (vgic_valid_spi(vcpu->kvm, intid))
55+
kvm_notify_acked_irq(vcpu->kvm, 0,
56+
intid - VGIC_NR_PRIVATE_IRQS);
5557
}
5658
}
5759

virt/kvm/arm/vgic/vgic-v3.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ void vgic_v3_process_maintenance(struct kvm_vcpu *vcpu)
4141

4242
WARN_ON(cpuif->vgic_lr[lr] & ICH_LR_STATE);
4343

44-
kvm_notify_acked_irq(vcpu->kvm, 0,
45-
intid - VGIC_NR_PRIVATE_IRQS);
44+
/* Only SPIs require notification */
45+
if (vgic_valid_spi(vcpu->kvm, intid))
46+
kvm_notify_acked_irq(vcpu->kvm, 0,
47+
intid - VGIC_NR_PRIVATE_IRQS);
4648
}
4749

4850
/*

0 commit comments

Comments
 (0)