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,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
Xiaoyao Li <xiaoyao.li@intel.com>,
Kai Huang <kai.huang@intel.com>, Yan Zhao <yan.y.zhao@intel.com>,
Binbin Wu <binbin.wu@linux.intel.com>
Subject: [PATCH v2 0/2] KVM: VMX: Explicitly track TDX VMs' root level
Date: Wed, 26 Aug 2026 14:52:56 -0700 [thread overview]
Message-ID: <20260826215258.937210-1-seanjc@google.com> (raw)
Fix a bug where a misbehaving (or niave?) userspace can configure guest CPUID
such that KVM will use the "wrong" root level for its mirror EPTs and trip the
KVM_BUG_ON() in tdx_load_mmu_pgd().
v2:
- Rewrite the comment in kvm_mmu_get_tdp_level(). [Rick]
- Check for kvm_has_mirrored_tdp() in kvm_mmu_get_tdp_level(), and yell if
arch.mirror_root_level isn't also set. [Rick]
- Separate the removal of TDX_SHARED_BIT_PWL_{4,5} from the bug fix. [Rick]
- Fix a buring => buried typo. [Binbin]
- Collect Tested/Reviewed-by. [Binbin, Rick, Yan] (I applied 'em only to
patch 1, please holler if that doesn't seem right).
v1: https://lore.kernel.org/all/20260814224509.2342760-1-seanjc@google.com
Sean Christopherson (2):
KVM: VMX: Explicitly track TDX VMs' root level instead of guessing it
from CPUID
KVM: VMX: Drop TDX_SHARED_BIT_PWL_{4,5} and dedup related code
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/cpuid.c | 14 --------------
arch/x86/kvm/cpuid.h | 1 -
arch/x86/kvm/mmu/mmu.c | 19 +++++++++++--------
arch/x86/kvm/vmx/tdx.c | 20 +++++++++++---------
5 files changed, 23 insertions(+), 32 deletions(-)
base-commit: 76671054f9a1ff6abb976583cd8da37650acdc97
--
2.55.0.887.g758fc8c411-goog
next reply other threads:[~2026-08-26 21:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 21:52 Sean Christopherson [this message]
2026-08-26 21:52 ` [PATCH v2 1/2] KVM: VMX: Explicitly track TDX VMs' root level instead of guessing it from CPUID Sean Christopherson
2026-08-26 22:08 ` sashiko-bot
2026-08-26 22:23 ` Sean Christopherson
2026-08-26 21:52 ` [PATCH v2 2/2] KVM: VMX: Drop TDX_SHARED_BIT_PWL_{4,5} and dedup related code 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=20260826215258.937210-1-seanjc@google.com \
--to=seanjc@google.com \
--cc=binbin.wu@linux.intel.com \
--cc=kai.huang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rick.p.edgecombe@intel.com \
--cc=xiaoyao.li@intel.com \
--cc=yan.y.zhao@intel.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