aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Upton <oliver.upton@linux.dev>2024-02-21 09:27:31 +0000
committerMarc Zyngier <maz@kernel.org>2024-02-21 10:06:41 +0000
commit8d3a7dfb801d157ac423261d7cd62c33e95375f8 (patch)
tree5eec37f6d24d34b18fdccf9dee0a3b441137b619
parentc60d847be7b8e69e419e02a2b3d19c2842a3c35d (diff)
downloadlinux-8d3a7dfb801d157ac423261d7cd62c33e95375f8.tar.gz
KVM: arm64: vgic-its: Test for valid IRQ in its_sync_lpi_pending_table()
vgic_get_irq() may not return a valid descriptor if there is no ITS that holds a valid translation for the specified INTID. If that is the case, it is safe to silently ignore it and continue processing the LPI pending table. Cc: stable@vger.kernel.org Fixes: 33d3bc9556a7 ("KVM: arm64: vgic-its: Read initial LPI pending table") Signed-off-by: Oliver Upton <oliver.upton@linux.dev> Link: https://lore.kernel.org/r/20240221092732.4126848-2-oliver.upton@linux.dev Signed-off-by: Marc Zyngier <maz@kernel.org>
Notes
Fixes: 33d3bc9556a7 ("KVM: arm64: vgic-its: Read initial LPI pending table") # v4.8-rc1 Stable: 3f70ed98f776 # v6.6.19 Stable: 3ac3624a74cf # v6.1.80 Stable: d81e2dc20395 # v5.15.150 Stable: 6e5069b40fb4 # v5.10.211 Stable: 68799371c9c1 # v5.4.270 Stable: c2462b26faab # v4.19.308 Lore: https://lore.kernel.org/r/20240221092732.4126848-2-oliver.upton@linux.dev # kvmarm, stable Lore: https://lore.kernel.org/r/20240226213822.1228736-2-oliver.upton@linux.dev # stable Lore: https://lore.kernel.org/r/20240226215612.1387774-2-oliver.upton@linux.dev # stable Lore: https://lore.kernel.org/r/20240227131550.145939523@linuxfoundation.org # linux-patches, stable Lore: https://lore.kernel.org/r/20240227131552.915484885@linuxfoundation.org # linux-patches, stable Lore: https://lore.kernel.org/r/20240227131601.257628033@linuxfoundation.org # linux-patches, stable Lore: https://lore.kernel.org/r/20240227131613.903749245@linuxfoundation.org # linux-patches, stable Lore: https://lore.kernel.org/r/20240227131617.932501709@linuxfoundation.org # linux-patches, stable Lore: https://lore.kernel.org/r/20240227131631.250930034@linuxfoundation.org # linux-patches, stable Lore: https://lore.kernel.org/r/20240227131636.788638122@linuxfoundation.org # linux-patches, stable
-rw-r--r--arch/arm64/kvm/vgic/vgic-its.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c
index e2764d0ffa9f3..082448de27ed9 100644
--- a/arch/arm64/kvm/vgic/vgic-its.c
+++ b/arch/arm64/kvm/vgic/vgic-its.c
@@ -468,6 +468,9 @@ static int its_sync_lpi_pending_table(struct kvm_vcpu *vcpu)
}
irq = vgic_get_irq(vcpu->kvm, NULL, intids[i]);
+ if (!irq)
+ continue;
+
raw_spin_lock_irqsave(&irq->irq_lock, flags);
irq->pending_latch = pendmask & (1U << bit_nr);
vgic_queue_irq_unlock(vcpu->kvm, irq, flags);