]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: cache maxphyaddr CPUID leaf in struct kvm_vcpu
authorEugene Korenevsky <ekorenevsky@gmail.com>
Sun, 29 Mar 2015 20:56:12 +0000 (23:56 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Apr 2015 08:46:56 +0000 (10:46 +0200)
commit4f93e725f46e2968de7d13ae95cb2fdf3f69ae96
tree8350e79b1b046374a5b4658dc498a3f8b1e8b8f5
parent4d0d29a9d29f2afba1320be6b4997d91f1078455
KVM: x86: cache maxphyaddr CPUID leaf in struct kvm_vcpu

cpuid_maxphyaddr(), which performs lot of memory accesses is called
extensively across KVM, especially in nVMX code.

This patch adds a cached value of maxphyaddr to vcpu.arch to reduce the
pressure onto CPU cache and simplify the code of cpuid_maxphyaddr()
callers. The cached value is initialized in kvm_arch_vcpu_init() and
reloaded every time CPUID is updated by usermode. It is obvious that
these reloads occur infrequently.

Signed-off-by: Eugene Korenevsky <ekorenevsky@gmail.com>
Message-Id: <20150329205612.GA1223@gnote>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/cpuid.c
arch/x86/kvm/cpuid.h
arch/x86/kvm/x86.c