]> git.baikalelectronics.ru Git - kernel.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)
commit8c70c6f96a7c3d071d72c8a7dc174a93bbb520f1
treeccb089dc2bd41e92d0f0e7adf3891a34f57a325e
parenta6651fb10baf0eba5c6f21d6b3e2f4a6b417f851
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