aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-05-25 10:01:50 -0400
committerAvi Kivity <avi@redhat.com>2010-08-01 03:39:22 -0400
commit10ab25cd6bf7ee4e5a55d81f203f7dc1a855c27e (patch)
tree89b1f58c09a102f1aa5c9b549c13e1f9a0a3ee3d /arch/x86/kvm/x86.c
parent6dc696d4ddf2181eefee361e1d24a49351aef1f6 (diff)
KVM: x86: Propagate fpu_alloc errors
Memory allocation may fail. Propagate such errors. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 033b9c207f93..e6e0d7781af7 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5114,12 +5114,19 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
5114 return 0; 5114 return 0;
5115} 5115}
5116 5116
5117void fx_init(struct kvm_vcpu *vcpu) 5117int fx_init(struct kvm_vcpu *vcpu)
5118{ 5118{
5119 fpu_alloc(&vcpu->arch.guest_fpu); 5119 int err;
5120
5121 err = fpu_alloc(&vcpu->arch.guest_fpu);
5122 if (err)
5123 return err;
5124
5120 fpu_finit(&vcpu->arch.guest_fpu); 5125 fpu_finit(&vcpu->arch.guest_fpu);
5121 5126
5122 vcpu->arch.cr0 |= X86_CR0_ET; 5127 vcpu->arch.cr0 |= X86_CR0_ET;
5128
5129 return 0;
5123} 5130}
5124EXPORT_SYMBOL_GPL(fx_init); 5131EXPORT_SYMBOL_GPL(fx_init);
5125 5132