[PATCH rebase/RFC 0/4] x86/kvm/nVMX: optimize MMU switch between L1 and L2

From: Paolo Bonzini
Date: Fri Jul 27 2018 - 12:56:48 EST


This is a rebased version of Vitaly's RFC series. This isn't
quite ready for application as I haven't yet thought through
the interactions between the root_mmu/guest_mmu split and
the multi-root caching.

Speaking of the multi-root caching, it is a bit of a duplicate work
with Vitaly's last three patches that avoided reinitialization if
the parameters and CR3 matched, so the series got smaller too.

The scalability improvement on the nested CPUID benchamrk is sensible:

-smp 1 -smp 16 -smp 48
4.18 18k 86k
kvm/queue 18k 68k
+gup_fast 18k 42k
+guest_mmu 18k 26k 42k

The slowdown between -smp 16 and -smp 48 is partly due to SMT,
because the machine has 28 cores.

Paolo

Vitaly Kuznetsov (4):
x86/kvm/mmu: make vcpu->mmu a pointer to the current MMU
x86/kvm/mmu.c: set get_pdptr hook in kvm_init_shadow_ept_mmu()
x86/kvm/mmu.c: add kvm_mmu parameter to kvm_mmu_free_roots()
x86/kvm/mmu: introduce guest_mmu

arch/x86/include/asm/kvm_host.h | 11 ++-
arch/x86/kvm/mmu.c | 183 +++++++++++++++++++++-------------------
arch/x86/kvm/mmu.h | 8 +-
arch/x86/kvm/mmu_audit.c | 12 +--
arch/x86/kvm/paging_tmpl.h | 15 ++--
arch/x86/kvm/svm.c | 14 +--
arch/x86/kvm/vmx.c | 43 ++++++----
arch/x86/kvm/x86.c | 20 ++---
8 files changed, 168 insertions(+), 138 deletions(-)

--
1.8.3.1