]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Micro-optimize vmexit time when not exposing PMU
authorWanpeng Li <wanpengli@tencent.com>
Fri, 13 Mar 2020 03:55:18 +0000 (11:55 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 16:58:58 +0000 (17:58 +0100)
commitc54086ec378b6c708c9c94fb45545554ac9fcda9
treea77a59dc86fd997e0b105ab004edc9b86d63a625
parent124a4ad8cb1e579ea31ef58e60d20ceab9c59ac5
KVM: VMX: Micro-optimize vmexit time when not exposing PMU

PMU is not exposed to guest by most of products from cloud providers since the
bad performance of PMU emulation and security concern. However, it calls
perf_guest_switch_get_msrs() and clear_atomic_switch_msr() unconditionally
even if PMU is not exposed to the guest before each vmentry.

~2% vmexit time reduced can be observed by kvm-unit-tests/vmexit.flat on my
SKX server.

Before patch:
vmcall 1559

After patch:
vmcall 1529

Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c