[Devel] [PATCH hci-8.1] ms/KVM: x86: Fix lost EOI when unmasking a pending level IOAPIC pin
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Mon Nov 2 14:17:43 MSK 2026
> When the guest unmasks a level-triggered redirection entry whose line is
> already asserted, ioapic_write_indirect() injects the pending interrupt
> first and only then asks the destination vCPUs to rescan their
> ioapic_handled_vectors and EOI exit bitmaps. If the same write also set
> the vector or the trigger mode, a destination vCPU can take the interrupt
> and EOI it before the rescan. A posted interrupt reaches a running vCPU
> without a VM exit, and the EOI is then either virtualized without an exit
> or dropped by kvm_ioapic_send_eoi() because the vector is not in
> ioapic_handled_vectors yet. Remote IRR stays set and the pin delivers no
> more interrupts until the guest reprograms it.
>
> Linux programs the entry masked and unmasks it with a separate write, so
> the vector is scanned before anything can be injected. Windows writes
> the vector, the trigger mode and the mask bit in one go. A virtio balloon
> on INTx whose line is already up when the driver connects its interrupt
> then stops receiving interrupts for the rest of the boot, and the guest
> ignores every later balloon target.
>
> Make the scan request before servicing the pending IRR. The request
> waits for the destination vCPUs to leave guest mode, and each of them
> rescans the routes and reloads its EOI exit bitmap before it can enter
> the guest and take the interrupt.
>
> Fixes: c7c9c56ca26f ("x86, apicv: add virtual interrupt delivery support")
> Fixes: 3bb345f387dd ("KVM: x86: store IOAPIC-handled vectors in each VCPU")
> Link: https://lore.kernel.org/kvm/20261029-kvm-ioapic-eoi-v1-den@openvz.org/
>
> https://virtuozzo.atlassian.net/browse/VSTOR-151727
> Feature: fix ms/kvm
> Signed-off-by: Denis V. Lunev <den at openvz.org>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261102105510.3330185-1-den@openvz.org?part=1
More information about the Devel
mailing list