]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
kvm: x86: Use task structs fpu field for user
authorMarc Orr <marcorr@google.com>
Tue, 6 Nov 2018 22:53:55 +0000 (14:53 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Dec 2018 17:00:07 +0000 (18:00 +0100)
commit240c35a3783ab9b3a0afaba0dde7291295680a6b
treeffa5607b5855f8390fe405dce733d7e7cf341b62
parent4e445aee9654dc4aee61919d4f1d379b77cf3435
kvm: x86: Use task structs fpu field for user

Previously, x86's instantiation of 'struct kvm_vcpu_arch' added an fpu
field to save/restore fpu-related architectural state, which will differ
from kvm's fpu state. However, this is redundant to the 'struct fpu'
field, called fpu, embedded in the task struct, via the thread field.
Thus, this patch removes the user_fpu field from the kvm_vcpu_arch
struct and replaces it with the task struct's fpu field.

This change is significant because the fpu struct is actually quite
large. For example, on the system used to develop this patch, this
change reduces the size of the vcpu_vmx struct from 23680 bytes down to
19520 bytes, when building the kernel with kvmconfig. This reduction in
the size of the vcpu_vmx struct moves us closer to being able to
allocate the struct at order 2, rather than order 3.

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/x86.c