KVM: arm64: vgic-its: Fixes for 6.8
Subsystems (3)
cover KVM: arm64: vgic-its: Fixes for 6.8
Spotted a couple issues in the way KVM's ITS emulation handles intids returned from vgic_copy_lpi_list().
Marc, I'd like to get these in ASAP, ideally as fixes for 6.8.
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
arch/arm64/kvm/vgic/vgic-its.c | 5 +++++ 1 file changed, 5 insertions(+)
base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d
Signature · 1 line
2.44.0.rc0.258.g7320e95886-goog
PATCH 1/2 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.
--- arch/arm64/kvm/vgic/vgic-its.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/kvm/vgic/vgic-its.c +3 -0
@@ -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);
Signature · 1 line
2.44.0.rc0.258.g7320e95886-goog
PATCH 2/2 KVM: arm64: vgic-its: Test for valid IRQ in MOVALL handler
In reply to Oliver UptonIt 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.
--- arch/arm64/kvm/vgic/vgic-its.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/kvm/vgic/vgic-its.c +2 -0
@@ -1435,6 +1435,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.rc0.258.g7320e95886-goog
Quoted 11 lines · Oliver Upton
Spotted a couple issues in the way KVM's ITS emulation handles intids returned from
vgic_copy_lpi_list().Marc, I'd like to get these in ASAP, ideally as fixes for 6.8.
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[...]
Applied to fixes, thanks!
[1/2] KVM: arm64: vgic-its: Test for valid IRQ in its_sync_lpi_pending_table()
commit: 8d3a7dfb801d157ac423261d7cd62c33e95375f8
[2/2] KVM: arm64: vgic-its: Test for valid IRQ in MOVALL handler
commit: 85a71ee9a0700f6c18862ef3b0011ed9dad99acaCheers,
M.
Signature · 1 line
Without deviation from the norm, progress is not possible.