aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 9c68a650f57e..2ae0c3923293 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -904,13 +904,18 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id)
904 svm->asid_generation = 0; 904 svm->asid_generation = 0;
905 init_vmcb(svm); 905 init_vmcb(svm);
906 906
907 fx_init(&svm->vcpu); 907 err = fx_init(&svm->vcpu);
908 if (err)
909 goto free_page4;
910
908 svm->vcpu.arch.apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE; 911 svm->vcpu.arch.apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
909 if (kvm_vcpu_is_bsp(&svm->vcpu)) 912 if (kvm_vcpu_is_bsp(&svm->vcpu))
910 svm->vcpu.arch.apic_base |= MSR_IA32_APICBASE_BSP; 913 svm->vcpu.arch.apic_base |= MSR_IA32_APICBASE_BSP;
911 914
912 return &svm->vcpu; 915 return &svm->vcpu;
913 916
917free_page4:
918 __free_page(hsave_page);
914free_page3: 919free_page3:
915 __free_pages(nested_msrpm_pages, MSRPM_ALLOC_ORDER); 920 __free_pages(nested_msrpm_pages, MSRPM_ALLOC_ORDER);
916free_page2: 921free_page2: