Skip to content

KVM: VMX: Explicitly track TDX VMs' root level

Sean Christopherson kvm lkml 3 versions – Applied

Status from this message: Applied to kvm-x86 misc, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 7 repliesApplied
  2. v22 patches 1 replySuperseded
  3. v11 patch 11 repliesSuperseded

Changes in v3 from the cover letter

- Use kvm_mmu_get_max_tdp_level() in __kvm_mmu_create() to avoid what is effectively a false positive WARN. [Sashiko]

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/3KVM: x86/mmu: Use KVM's max TDP level to determine need for 32-bit TDP rootarch/x86/kvm/mmu/mmu.c+1 -13 replies
2/3KVM: VMX: Explicitly track TDX VMs' root level instead of guessing it from CPUIDarch/x86/include/asm/kvm_host.h arch/x86/kvm/cpuid.c arch/x86/kvm/cpuid.h +2 more+24 -251 reply
3/3KVM: VMX: Drop TDX_SHARED_BIT_PWL_{4,5} and dedup related codearch/x86/kvm/vmx/tdx.c+4 -122 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchRick EdgecombeYan ZhaoBinbin WuXiaoyao Li
1/3R-b R-b
2/3R-b T-b T-b R-b R-b
3/3R-b T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/3] KVM: VMX: Explicitly track TDX VMs' root level

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().

v3:
- Use kvm_mmu_get_max_tdp_level() in __kvm_mmu_create() to avoid what is effectively a false positive WARN. [Sashiko]

v2:
- https://lore.kernel.org/all/[email protected]
- 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/[email protected]

Sean Christopherson (3):
KVM: x86/mmu: Use KVM's max TDP level to determine need for 32-bit TDP
root
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          | 21 ++++++++++++---------
 arch/x86/kvm/vmx/tdx.c          | 20 +++++++++++---------
 5 files changed, 24 insertions(+), 33 deletions(-)

base-commit: 76671054f9a1ff6abb976583cd8da37650acdc97

Signature · 1 line
2.55.0.970.g62bdec98f9-goog