From: Paolo Bonzini <pbonzini@redhat.com>
To: Wincy Van <fanwenyi0529@gmail.com>,
yang.z.zhang@intel.com, Bandan Das <bsd@redhat.com>
Cc: kvm@vger.kernel.org, Wanpeng Li <wanpeng.li@linux.intel.com>
Subject: Re: [question] Why newer QEMU may lose irq when doing migration?
Date: Wed, 17 Dec 2014 11:46:51 +0100 [thread overview]
Message-ID: <54915F1B.30107@redhat.com> (raw)
In-Reply-To: <CACzj_yX9_3JcVn1zXDk0-fbcWiOSeg6d3bbLNSM+=hC+M+pjWQ@mail.gmail.com>
On 17/12/2014 04:46, Wincy Van wrote:
> Hi, all:
>
> The patchset (https://lkml.org/lkml/2014/3/18/309) fixed migration of
> Windows guests, but commit 0bc830b05c667218d703f2026ec866c49df974fc
> (KVM: ioapic: clear IRR for edge-triggered interrupts at delivery)
> introduced a bug (see
> https://www.mail-archive.com/kvm@vger.kernel.org/msg109813.html).
>
> From the description "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."
>
> Why could new QEMU do that? I can not find any codes about the "some reason"..
> As we know, once a irq is set in kvm's ioapic, the ioapic will send
> that irq to lapic, this is an "atomic" operation.
It can happen if the IRQ is masked in the IOAPIC, for example. Until
commit 0bc830b, KVM could not distinguish two cases:
1) an edge-triggered interrupt that was raised while the IOAPIC had it
masked
2) an edge-triggered interrupt that was raised and delivered, but for
which userspace left the level to 1.
> Then, kvm will inject them in inject_pending_event(or set rvi in
> apic-v case). QEMU will also save the pending irq when doing
> migration.
No, QEMU does not save the pending IRQ. IRQs are stateless in QEMU.
The assumption is that after a qemu_set_irq the IRQ will be
delivered---possibly on the other side of the migration, but it will be
delivered.
Paolo
> I can not find a point which guest could lose a irq, but this scenario
> really exists.
>
> Any ideas?
>
>
> Thanks,
>
> Wincy
>
next prev parent reply other threads:[~2014-12-17 10:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 3:46 [question] Why newer QEMU may lose irq when doing migration? Wincy Van
2014-12-17 10:46 ` Paolo Bonzini [this message]
2014-12-19 3:58 ` Wincy Van
2014-12-19 9:50 ` Paolo Bonzini
2014-12-22 13:55 ` Wincy Van
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54915F1B.30107@redhat.com \
--to=pbonzini@redhat.com \
--cc=bsd@redhat.com \
--cc=fanwenyi0529@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=wanpeng.li@linux.intel.com \
--cc=yang.z.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox