Re: [PATCH 1/3] KVM: SVM: Re-queue events that were never injected
From: Sean Christopherson
Date: Mon Sep 21 2026 - 09:35:02 EST
On Mon, Sep 14, 2026, Pratik R. Sampat wrote:
> When injecting an event into the guest via the event_inj field, a
> non-zero event_inj value on #VMEXIT means that the hardware was not able
> to inject the event into the guest. This used to only occur for the
> VMEXIT_INVALID intercept code, which was a fatal error and resulted in
> the guest being torn down.
>
> Enhanced SMT Protection (ESMTP) invalidates that assumption. When ESMTP
> is enabled, VMRUN doesn't enter guest mode immediately; it stalls at a
> synchronization point until every sibling thread is either idle or has
> executed VMRUN for a legal sibling vCPU. If an ESMTP timeout / illegal
> sibling exit / interrupt arrives while VMRUN is stalled, VMRUN can now
> terminate with the corresponding #VMEXIT intercept code, without
> entering guest mode, and thus without injecting the event.
>
> For example, on a 2-way SMT core running vCPU0 on thread 0 and vCPU1 on
> thread 1:
> Thread 0 (vCPU0) Thread 1 (vCPU1)
> ---------------- ----------------
> Interrupt A injected to the guest in host
> VMRUN |
> | |
> v |
> Stall waiting for sibling |
> | |
> | host INTR arrives on thread 0 |
> | while it waits |
> | |
> v |
> #VMEXIT v
> Interrupt B injected to the guest idle
> VMRUN
So how is KVM_RUN_FORCE_IMMEDIATE_EXIT supposed to work?