Re: CPU Lockups in KVM with deferred hrtimer rearming

Paolo Bonzini
2026-04-21T23:16:11Z

On Tue, Apr 21, 2026 at 11:48 PM Thomas Gleixner <tglx@kernel.org> wrote:
> On Tue, Apr 21 2026 at 21:39, Paolo Bonzini wrote:
> > ... it's not decades, ack on VM exit is actually relatively recent (10
> > years out 20 :)). The reason why it was introduced is another killer
> > for the idea, though. Posted interrupts require it, for some reason
> > only known to Intel.
>
> That's yet another attempt to provide an halfways decent argument, but
> as anything else related to KVM/VIRT it is neither documented nor proven
> to be true.

SDM, "27.2.1 Checks on VMX Controls", under "VM-Execution Control Fields":

If the “process posted interrupts” VM-execution control is 1, the
following must be true: [...]
— The “acknowledge interrupt on exit” VM-exit control is 1.

I grant you the "not documented" (not cross referenced to the manual
in commit 01e439be775) part, but "not proven to be true"? Neither I
nor my predecessors are *that* clueless.

And under "posted-interrupt processing" the following two steps are listed:

1. The local APIC is acknowledged; this provides the processor core
with an interrupt vector, called here the physical vector.
2. If the physical vector equals the posted-interrupt notification
vector, the logical processor continues to the next step. Otherwise, a
VM exit occurs as it would normally due to an external interrupt; the
vector is saved in the VM-exit interruption-information field.

So the reason is actually documented by the SDM: "ack intr on exit" is
needed in order to retrieve the interrupt vector, which is then
compared against the posted-interrupt notification vector. As far as
the APIC is concerned, the interrupt is gone; there's no way to "send
it back" and have it delivered after IF=1.

> Your claim is just another prove of the KVM handwaving approach as the
> change log which introduced this (commit a547c6db4d2f) does not mention
> it at all. In fact posted interrupt support came _three_ years after
> that and there is exactly _zero_ information about this dependency if I
> read the relevant change logs correctly.

No, posted interrupt support on the CPU (not in interrupt remapping)
arrived in the same series with commit 5a71785dde30 ("KVM: VMX: Use
posted interrupt to deliver virtual interrupt", 2013-04-16).

There were two different steps. Posted interrupt support on the CPU
was introduced in Ivy Bridge. Posted interrupt support on the IOMMU in
Broadwell (and added to KVM with commit efc644048ecd, "KVM: x86:
Update IRTE for posted-interrupts", 2015-10-01). New virt features
used to come on the "tock" instead of the "tick").

> Where exactly is the reference to posted interrupts and how did you or
> someone else establish that this hack is a requirement for posted
> interrupts in the first place?

Is reading the manual enough?

Paolo