Skip to contentSkip to conversation

KVM: arm64: VGIC ITS fix backports

PATCH In review Oliver Upton 2 participants 4 messages Feb 26, 2024 – Feb 27, 2024 Stable branch

lore
Share & tools
lore
#0 lore raw

cover KVM: arm64: VGIC ITS fix backports

Oliver Upton (2):
KVM: arm64: vgic-its: Test for valid IRQ in
its_sync_lpi_pending_table()
KVM: arm64: vgic-its: Test for valid IRQ in MOVALL handler

 virt/kvm/arm/vgic/vgic-its.c | 5 +++++
 1 file changed, 5 insertions(+)

base-commit: ab219d38aef198d26083cc800954d352acd5137b

Signature · 1 line
2.44.0.rc1.240.g4c46232300-goog
#1 lore raw

PATCH 1/2 KVM: arm64: vgic-its: Test for valid IRQ in its_sync_lpi_pending_table()

commit 8d3a7dfb801d157ac423261d7cd62c33e95375f8 upstream.

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.

Fixes 33d3bc9556a7 ("KVM: arm64: vgic-its: Read initial LPI pending table")
---
 virt/kvm/arm/vgic/vgic-its.c | 3 +++
 1 file changed, 3 insertions(+)
virt/kvm/arm/vgic/vgic-its.c +3 -0
index cb36774a750c..30d1809f720b 100644
@@ -469,6 +469,9 @@ static int its_sync_lpi_pending_table(struct kvm_vcpu *vcpu)
 		}
 
 		irq = vgic_get_irq(vcpu->kvm, NULL, intids[i]);
+		if (!irq)
+			continue;
+
 		spin_lock_irqsave(&irq->irq_lock, flags);
 		irq->pending_latch = pendmask & (1U << bit_nr);
 		vgic_queue_irq_unlock(vcpu->kvm, irq, flags);
Signature · 1 line
2.44.0.rc1.240.g4c46232300-goog
#2 lore raw

PATCH 2/2 KVM: arm64: vgic-its: Test for valid IRQ in MOVALL handler

In reply to Oliver Upton

commit 85a71ee9a0700f6c18862ef3b0011ed9dad99aca upstream.

It is possible that an LPI mapped in a different ITS gets unmapped while handling the MOVALL command. If that is the case, there is no state that can be migrated to the destination. Silently ignore it and continue migrating other LPIs.

Fixes ff9c114394aa ("KVM: arm/arm64: GICv4: Handle MOVALL applied to a vPE")
---
 virt/kvm/arm/vgic/vgic-its.c | 2 ++
 1 file changed, 2 insertions(+)
virt/kvm/arm/vgic/vgic-its.c +2 -0
index 30d1809f720b..2fb26bd3106e 100644
@@ -1232,6 +1232,8 @@ static int vgic_its_cmd_handle_movall(struct kvm *kvm, struct vgic_its *its,
 
 	for (i = 0; i < irq_count; i++) {
 		irq = vgic_get_irq(kvm, NULL, intids[i]);
+		if (!irq)
+			continue;
 
 		update_affinity(irq, vcpu2);
 
Signature · 1 line
2.44.0.rc1.240.g4c46232300-goog
maintainer
#3 lore raw
In reply to Oliver Upton
Quoted 7 lines · Oliver Upton

Oliver Upton (2):
KVM: arm64: vgic-its: Test for valid IRQ in
its_sync_lpi_pending_table()
KVM: arm64: vgic-its: Test for valid IRQ in MOVALL handler

 virt/kvm/arm/vgic/vgic-its.c | 5 +++++
 1 file changed, 5 insertions(+)

All now queued up, thanks!

greg k-h