Skip to content

KVM: VMX: EPTP cleanups and nVMX fixes

Sean Christopherson kvm lkml 1 version Applied

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/9KVM: VMX: Hoist construct_eptp() "up" in vmx.carch/x86/kvm/vmx/vmx.c+14 -140 replies
2/9KVM: nVMX: Hardcode dummy EPTP used for early nested consistency checksarch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/vmx.c arch/x86/kvm/vmx/vmx.h+4 -70 replies
3/9KVM: x86/mmu: Move "dummy root" helpers to spte.harch/x86/kvm/mmu/mmu_internal.h arch/x86/kvm/mmu/spte.h+10 -100 replies
4/9KVM: VMX: Use kvm_mmu_page role to construct EPTP, not current vCPU statearch/x86/kvm/vmx/vmx.c+30 -110 replies
5/9KVM: nVMX: Add consistency check for TPR_THRESHOLD[31:4]!=0 without VIDarch/x86/kvm/vmx/nested.c+3 -00 replies
6/9KVM: nVMX: Add consistency check for TSC_MULTIPLIER=0arch/x86/kvm/vmx/nested.c+4 -00 replies
7/9KVM: nVMX: Stuff vmcs02.TSC_MULTIPLIER early on for nested early checksarch/x86/kvm/vmx/nested.c+7 -00 replies
8/9KVM: nVMX: Remove support for "early" consistency checks via hardwarearch/x86/kvm/vmx/nested.c+12 -1180 replies
9/9KVM: nVMX: Add an off-by-default module param to WARN on missed consistency checksarch/x86/kvm/vmx/nested.c+43 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] KVM: VMX: EPTP cleanups and nVMX fixes

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/[email protected]

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

Signature · 1 line
2.51.0.470.ga7dc726c21-goog