summaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorWanpeng Li2019-07-22 06:26:21 +0200
committerPaolo Bonzini2019-07-22 13:55:48 +0200
commitd9a710e5fc4941944d565b013414e9fdc66242b5 (patch)
tree9f832b1d46c0addf58003df168a347e43707ed11 /arch/x86/include
parentKVM: X86: Fix fpu state crash in kvm guest (diff)
downloadkernel-qcow2-linux-d9a710e5fc4941944d565b013414e9fdc66242b5.tar.gz
kernel-qcow2-linux-d9a710e5fc4941944d565b013414e9fdc66242b5.tar.xz
kernel-qcow2-linux-d9a710e5fc4941944d565b013414e9fdc66242b5.zip
KVM: X86: Dynamically allocate user_fpu
After reverting commit 240c35a3783a (kvm: x86: Use task structs fpu field for user), struct kvm_vcpu is 19456 bytes on my server, PAGE_ALLOC_COSTLY_ORDER(3) is the order at which allocations are deemed costly to service. In serveless scenario, one host can service hundreds/thoudands firecracker/kata-container instances, howerver, new instance will fail to launch after memory is too fragmented to allocate kvm_vcpu struct on host, this was observed in some cloud provider product environments. This patch dynamically allocates user_fpu, kvm_vcpu is 15168 bytes now on my Skylake server. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Wanpeng Li <wanpengli@tencent.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/kvm_host.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index b2f1ffb937af..e74f0711eaaf 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -616,7 +616,7 @@ struct kvm_vcpu_arch {
* "guest_fpu" state here contains the guest FPU context, with the
* host PRKU bits.
*/
- struct fpu user_fpu;
+ struct fpu *user_fpu;
struct fpu *guest_fpu;
u64 xcr0;