Skip to content

KVM: nVMX: Optimize nested VM-Entry

Sean Christopherson kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest15 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15KVM: nVMX: Don't dump VMCS if virtual APIC page can't be mappedarch/x86/kvm/vmx/nested.c+0 -31 reply
2/15KVM: VMX: Always signal #GP on WRMSR to MSR_IA32_CR_PAT with bad valuearch/x86/kvm/vmx/vmx.c+3 -20 replies
3/15KVM: nVMX: Always sync GUEST_BNDCFGS when it comes from vmcs01arch/x86/kvm/vmx/nested.c+6 -70 replies
4/15KVM: nVMX: Write ENCLS-exiting bitmap once per vmcs02arch/x86/kvm/vmx/nested.c+3 -30 replies
5/15KVM: nVMX: Don't rewrite GUEST_PML_INDEX during nested VM-Entryarch/x86/kvm/vmx/nested.c+9 -111 reply
6/15KVM: nVMX: Don't "put" vCPU or host state when switching VMCSarch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/vmx.c arch/x86/kvm/vmx/vmx.h+48 -254 replies
7/15KVM: nVMX: Don't reread VMCS-agnostic state when switching VMCSarch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/vmx.c arch/x86/kvm/vmx/vmx.h+15 -71 reply
8/15KVM: nVMX: Don't speculatively write virtual-APIC page addressarch/x86/kvm/vmx/nested.c+8 -130 replies
9/15KVM: nVMX: Don't speculatively write APIC-access page addressarch/x86/kvm/vmx/nested.c+0 -80 replies
10/15KVM: nVMX: Update vmcs12 for MSR_IA32_CR_PAT when it's writtenarch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/vmx.c+4 -40 replies
11/15KVM: nVMX: Update vmcs12 for SYSENTER MSRs when they're writtenarch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/vmx.c+6 -31 reply
12/15KVM: nVMX: Update vmcs12 for MSR_IA32_DEBUGCTLMSR when it's writtenarch/x86/kvm/vmx/nested.c arch/x86/kvm/vmx/vmx.c+9 -30 replies
13/15KVM: nVMX: Update vmcs02 GUEST_IA32_DEBUGCTL only when vmcs12 is dirtyarch/x86/kvm/vmx/nested.c+5 -11 reply
14/15KVM: nVMX: Don't update GUEST_BNDCFGS if it's clean in HV eVMCSarch/x86/kvm/vmx/nested.c+4 -40 replies
15/15KVM: nVMX: Copy PDPTRs to/from vmcs12 only when necessaryarch/x86/kvm/vmx/nested.c+21 -151 reply

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/15] KVM: nVMX: Optimize nested VM-Entry

The majority of patches in this series are loosely related optimizations to pick off low(ish) hanging fruit in nested VM-Entry, e.g. there are many VMREADs and VMWRITEs that can be optimized away without too much effort.

The major change (in terms of performance) is to not "put" the vCPU state when switching between vmcs01 and vmcs02, which can reudce the latency of a nested VM-Entry by upwards of 1000 cycles.

A few bug fixes are prepended as they touch code that happens to be modified by the various optimizations.

Sean Christopherson (15):
KVM: nVMX: Don't dump VMCS if virtual APIC page can't be mapped
KVM: VMX: Always signal #GP on WRMSR to MSR_IA32_CR_PAT with bad value
KVM: nVMX: Always sync GUEST_BNDCFGS when it comes from vmcs01
KVM: nVMX: Write ENCLS-exiting bitmap once per vmcs02
KVM: nVMX: Don't rewrite GUEST_PML_INDEX during nested VM-Entry
KVM: nVMX: Don't "put" vCPU or host state when switching VMCS
KVM: nVMX: Don't reread VMCS-agnostic state when switching VMCS
KVM: nVMX: Don't speculatively write virtual-APIC page address
KVM: nVMX: Don't speculatively write APIC-access page address
KVM: nVMX: Update vmcs12 for MSR_IA32_CR_PAT when it's written
KVM: nVMX: Update vmcs12 for SYSENTER MSRs when they're written
KVM: nVMX: Update vmcs12 for MSR_IA32_DEBUGCTLMSR when it's written
KVM: nVMX: Update vmcs02 GUEST_IA32_DEBUGCTL only when vmcs12 is dirty
KVM: nVMX: Don't update GUEST_BNDCFGS if it's clean in HV eVMCS
KVM: nVMX: Copy PDPTRs to/from vmcs12 only when necessary

 arch/x86/kvm/vmx/nested.c | 142 +++++++++++++++++++-------------------
 arch/x86/kvm/vmx/vmx.c    |  93 +++++++++++++++++--------
 arch/x86/kvm/vmx/vmx.h    |   5 +-
 3 files changed, 136 insertions(+), 104 deletions(-)
Signature · 1 line
2.21.0