aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 3bdaf298b8c7..57c76e86e9bd 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6461,6 +6461,10 @@ static int kvm_vcpu_reset(struct kvm_vcpu *vcpu)
6461 6461
6462 kvm_pmu_reset(vcpu); 6462 kvm_pmu_reset(vcpu);
6463 6463
6464 memset(vcpu->arch.regs, 0, sizeof(vcpu->arch.regs));
6465 vcpu->arch.regs_avail = ~0;
6466 vcpu->arch.regs_dirty = ~0;
6467
6464 return kvm_x86_ops->vcpu_reset(vcpu); 6468 return kvm_x86_ops->vcpu_reset(vcpu);
6465} 6469}
6466 6470
@@ -6629,11 +6633,17 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
6629 if (!zalloc_cpumask_var(&vcpu->arch.wbinvd_dirty_mask, GFP_KERNEL)) 6633 if (!zalloc_cpumask_var(&vcpu->arch.wbinvd_dirty_mask, GFP_KERNEL))
6630 goto fail_free_mce_banks; 6634 goto fail_free_mce_banks;
6631 6635
6636 r = fx_init(vcpu);
6637 if (r)
6638 goto fail_free_wbinvd_dirty_mask;
6639
6632 vcpu->arch.ia32_tsc_adjust_msr = 0x0; 6640 vcpu->arch.ia32_tsc_adjust_msr = 0x0;
6633 kvm_async_pf_hash_reset(vcpu); 6641 kvm_async_pf_hash_reset(vcpu);
6634 kvm_pmu_init(vcpu); 6642 kvm_pmu_init(vcpu);
6635 6643
6636 return 0; 6644 return 0;
6645fail_free_wbinvd_dirty_mask:
6646 free_cpumask_var(vcpu->arch.wbinvd_dirty_mask);
6637fail_free_mce_banks: 6647fail_free_mce_banks:
6638 kfree(vcpu->arch.mce_banks); 6648 kfree(vcpu->arch.mce_banks);
6639fail_free_lapic: 6649fail_free_lapic: