The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Doug Covelli <doug.covelli@broadcom.com>
Subject: [PATCH v2 0/2] KVM: SVM: Fix an STI shadow on VMRUN bug
Date: Mon, 24 Feb 2025 08:54:40 -0800	[thread overview]
Message-ID: <20250224165442.2338294-1-seanjc@google.com> (raw)

Fix a bug where KVM puts VMRUN in an STI shadow, which AMD CPUs bleed
into guest state if a #VMEXIT occurs before completing the VMRUN, e.g.
if vectoring an injected exception triggers an exit.

v2: Use "raw" variants to avoid tracing in noinstr code. [kernel test robot]

v1: https://lore.kernel.org/all/20250215010946.1201353-1-seanjc@google.com

Sean Christopherson (2):
  KVM: SVM: Set RFLAGS.IF=1 in C code, to get VMRUN out of the STI
    shadow
  KVM: selftests: Assert that STI blocking isn't set after event
    injection

 arch/x86/kvm/svm/svm.c                             | 14 ++++++++++++++
 arch/x86/kvm/svm/vmenter.S                         | 10 +---------
 .../selftests/kvm/x86/nested_exceptions_test.c     |  2 ++
 3 files changed, 17 insertions(+), 9 deletions(-)


base-commit: fed48e2967f402f561d80075a20c5c9e16866e53
-- 
2.48.1.601.g30ceb7b040-goog


             reply	other threads:[~2025-02-24 16:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 16:54 Sean Christopherson [this message]
2025-02-24 16:54 ` [PATCH v2 1/2] KVM: SVM: Set RFLAGS.IF=1 in C code, to get VMRUN out of the STI shadow Sean Christopherson
2025-02-24 17:24   ` Jim Mattson
2025-02-24 16:54 ` [PATCH v2 2/2] KVM: selftests: Assert that STI blocking isn't set after event injection Sean Christopherson
2025-02-24 17:29   ` Jim Mattson
2025-02-28 23:40 ` [PATCH v2 0/2] KVM: SVM: Fix an STI shadow on VMRUN bug Sean Christopherson

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=20250224165442.2338294-1-seanjc@google.com \
    --to=seanjc@google.com \
    --cc=doug.covelli@broadcom.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox