diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/svm.c | 1 | ||||
-rw-r--r-- | arch/x86/kvm/vmx.c | 2 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 13 |
3 files changed, 13 insertions, 3 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 94f5ceba7e1e..161a5fa66d82 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -1251,7 +1251,6 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id) | |||
1251 | svm->vmcb_pa = page_to_pfn(page) << PAGE_SHIFT; | 1251 | svm->vmcb_pa = page_to_pfn(page) << PAGE_SHIFT; |
1252 | svm->asid_generation = 0; | 1252 | svm->asid_generation = 0; |
1253 | init_vmcb(svm); | 1253 | init_vmcb(svm); |
1254 | kvm_write_tsc(&svm->vcpu, 0); | ||
1255 | 1254 | ||
1256 | err = fx_init(&svm->vcpu); | 1255 | err = fx_init(&svm->vcpu); |
1257 | if (err) | 1256 | if (err) |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 896efd4842e7..bb18923bf632 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -3896,8 +3896,6 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx) | |||
3896 | vmcs_writel(CR0_GUEST_HOST_MASK, ~0UL); | 3896 | vmcs_writel(CR0_GUEST_HOST_MASK, ~0UL); |
3897 | set_cr4_guest_host_mask(vmx); | 3897 | set_cr4_guest_host_mask(vmx); |
3898 | 3898 | ||
3899 | kvm_write_tsc(&vmx->vcpu, 0); | ||
3900 | |||
3901 | return 0; | 3899 | return 0; |
3902 | } | 3900 | } |
3903 | 3901 | ||
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index a7b97a49d8ad..f3c069efc72a 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -6320,6 +6320,19 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) | |||
6320 | return r; | 6320 | return r; |
6321 | } | 6321 | } |
6322 | 6322 | ||
6323 | int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu) | ||
6324 | { | ||
6325 | int r; | ||
6326 | |||
6327 | r = vcpu_load(vcpu); | ||
6328 | if (r) | ||
6329 | return r; | ||
6330 | kvm_write_tsc(vcpu, 0); | ||
6331 | vcpu_put(vcpu); | ||
6332 | |||
6333 | return r; | ||
6334 | } | ||
6335 | |||
6323 | void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) | 6336 | void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) |
6324 | { | 6337 | { |
6325 | int r; | 6338 | int r; |