Skip to content

KVM: nVMX: Support loading MSRs before nested state

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5KVM: nVMX: Snapshot pre-VM-Enter BNDCFGS for !nested_run_pending casearch/x86/kvm/vmx/nested.c+2 -10 replies
2/5KVM: nVMX: Snapshot pre-VM-Enter DEBUGCTL for !nested_run_pending casearch/x86/kvm/vmx/nested.c+2 -10 replies
3/5KVM: nVMX: Rename nested.vmcs01_* fields to nested.pre_vmenter_*arch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/vmx.c arch/x86/kvm/vmx/vmx.h+23 -70 replies
4/5KVM: nVMX: Save BNDCFGS to vmcs12 iff relevant controls are exposed to L1arch/x86/kvm/vmx/nested.c+2 -10 replies
5/5KVM: nVMX: Update vmcs12 on BNDCFGS write, not at vmcs02=>vmcs12 syncarch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/vmx.c+6 -30 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/5] KVM: nVMX: Support loading MSRs before nested state

Fix two edge cases in nested VM-Enter where KVM loads garbage into BNDCFGS and/or DEBUGCTL when migrating a vCPU with L2 active. If userspace restores MSRs before nested state, userspace expects KVM to propagate L2's values to vmcs02. KVM already mostly handles this scenario, so even though I personally think it's rather ridiculous, it's easy for KVM to support, and given that our VMM does KVM_SET_MSRS before KVM_SET_NESTED_STATE...

Patches 4 and 5 are minor optimizations to handle BNDCFGS more like DEBUGCTL and/or the PKS MSR.

Sean Christopherson (5):
KVM: nVMX: Snapshot pre-VM-Enter BNDCFGS for !nested_run_pending case
KVM: nVMX: Snapshot pre-VM-Enter DEBUGCTL for !nested_run_pending case
KVM: nVMX: Rename nested.vmcs01_* fields to nested.pre_vmenter_*
KVM: nVMX: Save BNDCFGS to vmcs12 iff relevant controls are exposed to

    L1

KVM: nVMX: Update vmcs12 on BNDCFGS write, not at vmcs02=>vmcs12 sync

 arch/x86/kvm/vmx/nested.c | 16 ++++++++--------
 arch/x86/kvm/vmx/vmx.c    | 13 +++++++++++++
 arch/x86/kvm/vmx/vmx.h    | 15 ++++++++++++---
 3 files changed, 33 insertions(+), 11 deletions(-)

base-commit: 8baacf67c76c560fed954ac972b63e6e59a6fba0

Signature · 1 line
2.36.1.476.g0c4daa206d-goog