From: "Huang, Kai" <kai.huang@intel.com>
To: "seanjc@google.com" <seanjc@google.com>,
"hao_zhang_kdev@163.com" <hao_zhang_kdev@163.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>
Subject: Re: [PATCH v4 3/4] KVM: x86: ioapic: Preserve irr_delivered for duplicate edge interrupts
Date: Tue, 11 Aug 2026 11:27:38 +0000 [thread overview]
Message-ID: <14bd0c1bbc7e133e5e7bc453bed3c0774f39f5a6.camel@intel.com> (raw)
In-Reply-To: <anrSJmPCKNe6jaUc@192.168.1.215>
On Tue, 2026-08-11 at 15:41 +0800, Hao Zhang wrote:
> From: Hao Zhang <zhanghao1@kylinos.cn>
>
> For edge-triggered interrupts, ioapic_set_irq() clears irr_delivered
> before checking whether the new edge is a duplicate. A duplicate edge
> is then coalesced without being serviced, leaving the interrupt visible
> in KVM_GET_IRQCHIP state even though the original interrupt was already
> delivered.
>
> Move the state update after the duplicate-edge check so duplicate edges
> do not make a delivered interrupt appear pending during VM migration.
ioapic_set_irq() returns 0 for coalesced edge triggered IRQ, meaning it is
considered not delivered. I don't see a problem if it is marked as pending in
ioapic->irr during KVM_GET_IRQCHIP for migration? It seems the result is the
coalesced IRQ will get re-injected, but what's wrong of this?
But I am not sure on this, so will leave to maintainers.
>
> Add a selftest to verify that a duplicate edge interrupt does not make
> an already-delivered interrupt visible in the saved IRR state.
IMO it's better to split kselftest changes to a separate patch out of KVM
changes.
>
> Fixes: 5bda6eed2e36 ("KVM: ioapic: Record edge-triggered interrupts delivery status")
When this commit was merged, AFAICT the then ioapic_set_irq() didn't support
coalesced edge triggered IRQ at all, so technically this one shouldn't be the
one to blame.
next prev parent reply other threads:[~2026-08-11 11:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 7:34 [PATCH v4 1/4] KVM: x86: ioapic: Update remote_irr only after successful delivery Hao Zhang
2026-08-11 7:39 ` [PATCH v4 2/4] KVM: selftests: Verify failed IOAPIC delivery preserves state Hao Zhang
2026-08-11 7:41 ` [PATCH v4 3/4] KVM: x86: ioapic: Preserve irr_delivered for duplicate edge interrupts Hao Zhang
2026-08-11 11:27 ` Huang, Kai [this message]
2026-08-11 7:43 ` [PATCH v4 4/4] KVM: x86: ioapic: Clear irr_delivered on level-triggered RTE Hao Zhang
2026-08-11 11:43 ` Huang, Kai
2026-08-11 11:11 ` [PATCH v4 1/4] KVM: x86: ioapic: Update remote_irr only after successful delivery Huang, Kai
2026-08-11 23:32 ` Huang, Kai
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=14bd0c1bbc7e133e5e7bc453bed3c0774f39f5a6.camel@intel.com \
--to=kai.huang@intel.com \
--cc=hao_zhang_kdev@163.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.