]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
x86/kvm/mmu: introduce guest_mmu
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 8 Oct 2018 19:28:08 +0000 (21:28 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Oct 2018 22:30:04 +0000 (00:30 +0200)
commit14c07ad89f4d728a468caaea6a769c018c2b8dd6
treeccb089dc2bd41e92d0f0e7adf3891a34f57a325e
parent6a82cd1c7b1e38d3b940fcb35a81e902dd52fb35
x86/kvm/mmu: introduce guest_mmu

When EPT is used for nested guest we need to re-init MMU as shadow
EPT MMU (nested_ept_init_mmu_context() does that). When we return back
from L2 to L1 kvm_mmu_reset_context() in nested_vmx_load_cr3() resets
MMU back to normal TDP mode. Add a special 'guest_mmu' so we can use
separate root caches; the improved hit rate is not very important for
single vCPU performance, but it avoids contention on the mmu_lock for
many vCPUs.

On the nested CPUID benchmark, with 16 vCPUs, an L2->L1->L2 vmexit
goes from 42k to 26k cycles.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu.c
arch/x86/kvm/vmx.c