]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: cache secondary exec controls
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 24 Aug 2017 11:55:35 +0000 (13:55 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 24 Aug 2017 13:35:14 +0000 (15:35 +0200)
commit127d6378ffed53dd53bc4b86d15ae65804ee645b
tree44a3b127ce9e25c58528bd44990ca9624260667c
parentcf65d1a673e32cd7c743d094ef2ca4ae0697d0dd
KVM: VMX: cache secondary exec controls

Currently, secondary execution controls are divided in three groups:

- static, depending mostly on the module arguments or the processor
  (vmx_secondary_exec_control)

- static, depending on CPUID (vmx_cpuid_update)

- dynamic, depending on nested VMX or local APIC state

Because walking CPUID is expensive, prepare_vmcs02 is using only
the first group.  This however is unnecessarily complicated.  Just
cache the static secondary execution controls, and then prepare_vmcs02
does not need to compute them every time.  Computation of all static
secondary execution controls is now kept in a single function,
vmx_compute_secondary_exec_control.

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