From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH v2 0/4] KVM: cleanup ioapic and fix KVM_SET_IRQCHIP with irr != 0 Date: Mon, 24 Mar 2014 18:59:32 +0100 Message-ID: <20140324175932.GA9199@potion.brq.redhat.com> References: <1395394081-16252-1-git-send-email-pbonzini@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, gleb@kernel.org, mtosatti@redhat.com, alex.williamson@redhat.com, jan.kiszka@siemens.com To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <1395394081-16252-1-git-send-email-pbonzini@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2014-03-21 10:27+0100, Paolo Bonzini: > Unlike the old qemu-kvm, which really never did that, with new QEMU > it is for some reason somewhat likely to migrate a VM with a nonzero > IRR in the ioapic. In the case of ISA edge-triggered interrupts, > this represents an interrupt that has not left the IOAPIC, which woul= d > be okay but it is not handled right by KVM_SET_IRQCHIP. Because the > interrupt is never injected, the guest never acknowledges it, the hos= t > never deasserts the pin and new interrupts are dropped. >=20 > There are two problems to solve. >=20 > The obvious one is that interrupts are not reinjected upon KVM_SET_IR= QCHIP, > which is taken care of by patches 3-4. >=20 > The second is that right now the IRR value depends on the falling edg= e > of the interrupt (as passed by the userspace via kvm_ioapic_set_irq). > This is unnecessary, and may lead to spurious reinjection in the > destination of migration; instead, we can clear the (internal-only) > IRR bit as soon as the interrupt leaves the IOAPIC. This is done by > patch 2, which patch 1 prepares for. >=20 > This fixes migration of Windows guests without HPET. Please review. >=20 > Paolo >=20 > v1->v2: > more comments in patch 3 > change argument name in patch 3 from level to irq_level > use IOAPIC_NUM_PINS in patch 4 as a limit to for_each_set_bit > remove debug printk in patch 4 Nice solution to a tricky problem, Reviewed-by: Radim Kr=C4=8Dm=C3=A1=C5=99 > Paolo Bonzini (4): > KVM: ioapic: merge ioapic_deliver into ioapic_service > KVM: ioapic: clear IRR for edge-triggered interrupts at delivery > KVM: ioapic: extract body of kvm_ioapic_set_irq > KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP >=20 > virt/kvm/ioapic.c | 107 +++++++++++++++++++++++++++++++++++---------= ---------- > 1 file changed, 69 insertions(+), 38 deletions(-) >=20 > --=20 > 1.8.3.1 >=20 > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html