mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/5] KVM: nVMX: Support loading MSRs before nested state
@ 2022-06-14 21:58 Sean Christopherson
  2022-06-14 21:58 ` [PATCH 1/5] KVM: nVMX: Snapshot pre-VM-Enter BNDCFGS for !nested_run_pending case Sean Christopherson
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Sean Christopherson @ 2022-06-14 21:58 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson,
	Joerg Roedel, kvm, linux-kernel, Lei Wang

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
-- 
2.36.1.476.g0c4daa206d-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-15 12:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14 21:58 [PATCH 0/5] KVM: nVMX: Support loading MSRs before nested state Sean Christopherson
2022-06-14 21:58 ` [PATCH 1/5] KVM: nVMX: Snapshot pre-VM-Enter BNDCFGS for !nested_run_pending case Sean Christopherson
2022-06-14 21:58 ` [PATCH 2/5] KVM: nVMX: Snapshot pre-VM-Enter DEBUGCTL " Sean Christopherson
2022-06-14 21:58 ` [PATCH 3/5] KVM: nVMX: Rename nested.vmcs01_* fields to nested.pre_vmenter_* Sean Christopherson
2022-06-14 21:58 ` [PATCH 4/5] KVM: nVMX: Save BNDCFGS to vmcs12 iff relevant controls are exposed to L1 Sean Christopherson
2022-06-14 21:58 ` [PATCH 5/5] KVM: nVMX: Update vmcs12 on BNDCFGS write, not at vmcs02=>vmcs12 sync Sean Christopherson
2022-06-15 12:53 ` [PATCH 0/5] KVM: nVMX: Support loading MSRs before nested state Paolo Bonzini

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®