mirror of https://lore.kernel.org/lkml/
 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
Subject: [PATCH 0/9] KVM: VMX: EPTP cleanups and nVMX fixes
Date: Thu, 18 Sep 2025 17:59:46 -0700	[thread overview]
Message-ID: <20250919005955.1366256-1-seanjc@google.com> (raw)

This started as a trivial series to cleanup KVM's handling of EPTPs in
anticipation of eliding TLB flushes on task migration[*], but then I made the
mistake of trying to test the nested_early_check change, and things snowballed.

Long story short, nested_early_check is obviously not being used as it's been
broken for years, and it's not adding value.  E.g. doesn't help us find KVM
bugs, and doesn't provide any meaningful protection for KVM (especially since
no one is using it).

So, I opted to fix nested_early_check, and then rip it out and replace it with
a param that can be enabled by developers/maintainers to find KVM bugs (which
in hindsight is what we should have done from the beginning).  I went through
the effort of fixing nested_early_check so that in the unlikely case someone
wants to resurrect it, they should have a working commit to jump back to.

[*] https://lore.kernel.org/all/aJKW9gTeyh0-pvcg@google.com

Sean Christopherson (9):
  KVM: VMX: Hoist construct_eptp() "up" in vmx.c
  KVM: nVMX: Hardcode dummy EPTP used for early nested consistency
    checks
  KVM: x86/mmu: Move "dummy root" helpers to spte.h
  KVM: VMX: Use kvm_mmu_page role to construct EPTP, not current vCPU
    state
  KVM: nVMX: Add consistency check for TPR_THRESHOLD[31:4]!=0 without
    VID
  KVM: nVMX: Add consistency check for TSC_MULTIPLIER=0
  KVM: nVMX: Stuff vmcs02.TSC_MULTIPLIER early on for nested early
    checks
  KVM: nVMX: Remove support for "early" consistency checks via hardware
  KVM: nVMX: Add an off-by-default module param to WARN on missed
    consistency checks

 arch/x86/kvm/mmu/mmu_internal.h |  10 --
 arch/x86/kvm/mmu/spte.h         |  10 ++
 arch/x86/kvm/vmx/nested.c       | 165 +++++++++++---------------------
 arch/x86/kvm/vmx/vmx.c          |  57 +++++++----
 arch/x86/kvm/vmx/vmx.h          |   1 -
 5 files changed, 105 insertions(+), 138 deletions(-)


base-commit: c8fbf7ceb2ae3f64b0c377c8c21f6df577a13eb4
-- 
2.51.0.470.ga7dc726c21-goog


             reply	other threads:[~2025-09-19  0:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19  0:59 Sean Christopherson [this message]
2025-09-19  0:59 ` [PATCH 1/9] KVM: VMX: Hoist construct_eptp() "up" in vmx.c Sean Christopherson
2025-09-19  0:59 ` [PATCH 2/9] KVM: nVMX: Hardcode dummy EPTP used for early nested consistency checks Sean Christopherson
2025-09-19  0:59 ` [PATCH 3/9] KVM: x86/mmu: Move "dummy root" helpers to spte.h Sean Christopherson
2025-09-19  0:59 ` [PATCH 4/9] KVM: VMX: Use kvm_mmu_page role to construct EPTP, not current vCPU state Sean Christopherson
2025-09-19  0:59 ` [PATCH 5/9] KVM: nVMX: Add consistency check for TPR_THRESHOLD[31:4]!=0 without VID Sean Christopherson
2025-09-19  0:59 ` [PATCH 6/9] KVM: nVMX: Add consistency check for TSC_MULTIPLIER=0 Sean Christopherson
2025-09-19  0:59 ` [PATCH 7/9] KVM: nVMX: Stuff vmcs02.TSC_MULTIPLIER early on for nested early checks Sean Christopherson
2025-09-19  0:59 ` [PATCH 8/9] KVM: nVMX: Remove support for "early" consistency checks via hardware Sean Christopherson
2025-09-19  0:59 ` [PATCH 9/9] KVM: nVMX: Add an off-by-default module param to WARN on missed consistency checks Sean Christopherson
2025-10-20 16:33 ` [PATCH 0/9] KVM: VMX: EPTP cleanups and nVMX fixes 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=20250919005955.1366256-1-seanjc@google.com \
    --to=seanjc@google.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

all inboxes | Powered by JetHome®