mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: "Pratik R. Sampat" <prsampat@amd.com>
Cc: kvm@vger.kernel.org, x86@kernel.org,
	linux-kernel@vger.kernel.org,  tglx@kernel.org, mingo@redhat.com,
	bp@alien8.de, dave.hansen@linux.intel.com,  pbonzini@redhat.com,
	thomas.lendacky@amd.com, kim.phillips@amd.com,  nikunj@amd.com,
	michael.roth@amd.com, ashish.kalra@amd.com
Subject: Re: [PATCH 1/3] KVM: SVM: Re-queue events that were never injected
Date: Mon, 21 Sep 2026 06:16:34 -0700	[thread overview]
Message-ID: <arEuMojZa_kv9VXA@google.com> (raw)
In-Reply-To: <d946de080e3dd34844a665c167179e4910fdc9d4.1789399214.git.prsampat@amd.com>

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?

  reply	other threads:[~2026-09-21 13:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 16:55 [PATCH 0/3] Introduce Enhanced SMT Protection for SEV-SNP Pratik R. Sampat
2026-09-14 16:55 ` [PATCH 1/3] KVM: SVM: Re-queue events that were never injected Pratik R. Sampat
2026-09-21 13:16   ` Sean Christopherson [this message]
2026-09-22 20:45     ` Pratik R. Sampat
2026-09-14 16:55 ` [PATCH 2/3] KVM: SVM: Add host support for Enhanced SMT Protection Pratik R. Sampat
2026-09-16 19:56   ` Borislav Petkov
2026-09-17 15:07     ` Pratik R. Sampat
2026-09-14 16:55 ` [PATCH 3/3] x86/sev: Add guest " Pratik R. Sampat

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=arEuMojZa_kv9VXA@google.com \
    --to=seanjc@google.com \
    --cc=ashish.kalra@amd.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=kim.phillips@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=nikunj@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=prsampat@amd.com \
    --cc=tglx@kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®