]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: x86: Dynamically allocate guest_fpu
authorMarc Orr <marcorr@google.com>
Tue, 6 Nov 2018 22:53:56 +0000 (14:53 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Dec 2018 17:00:08 +0000 (18:00 +0100)
commit2539c32cd1bcc9fcf3810a0cab5189774c4ce24f
treed79fd9e812f8b3fc6adf74fd587de062a062ca6b
parenta76d1ad7669585214c0c6294dfbbb61fee8eae8c
kvm: x86: Dynamically allocate guest_fpu

Previously, the guest_fpu field was embedded in the kvm_vcpu_arch
struct. Unfortunately, the field is quite large, (e.g., 4352 bytes on my
current setup). This bloats the kvm_vcpu_arch struct for x86 into an
order 3 memory allocation, which can become a problem on overcommitted
machines. Thus, this patch moves the fpu state outside of the
kvm_vcpu_arch struct.

With this patch applied, the kvm_vcpu_arch struct is reduced to 15168
bytes for vmx on my setup when building the kernel with kvmconfig.

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Marc Orr <marcorr@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c