When queue irq(whatever SGI, PPI, SPI) failed, that means the ICH_LRn is not enough, so, if this circs happened, skip the follow irq queue logic, and flag the HCR.UIE directly. Signed-off-by: wanghaibin <wanghaibin.wang@xxxxxxxxxx> --- virt/kvm/arm/vgic.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 8390475..12026e6 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -1415,20 +1415,26 @@ static void __kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu) /* SGIs */ for_each_set_bit(i, vgic_cpu->pending_percpu, VGIC_NR_SGIS) { - if (!vgic_queue_sgi(vcpu, i)) + if (!vgic_queue_sgi(vcpu, i)) { overflow = 1; + goto epilog; + } } /* PPIs */ for_each_set_bit_from(i, vgic_cpu->pending_percpu, VGIC_NR_PRIVATE_IRQS) { - if (!vgic_queue_hwirq(vcpu, i)) + if (!vgic_queue_hwirq(vcpu, i)) { overflow = 1; + goto epilog; + } } /* SPIs */ for_each_set_bit(i, vgic_cpu->pending_shared, vgic_nr_shared_irqs(dist)) { - if (!vgic_queue_hwirq(vcpu, i + VGIC_NR_PRIVATE_IRQS)) + if (!vgic_queue_hwirq(vcpu, i + VGIC_NR_PRIVATE_IRQS)) { overflow = 1; + goto epilog; + } } epilog: -- 1.7.1 _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm