diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2012-11-27 20:29:02 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-11-27 20:29:14 -0500 |
commit | 42897d866b120547777ae1fd316680ec53356d9c (patch) | |
tree | 29eb544b4361d964dab0d1b3e27f9f2e64597daf /arch/x86/kvm/x86.c | |
parent | d828199e84447795c6669ff0e6c6d55eb9beeff6 (diff) |
KVM: x86: add kvm_arch_vcpu_postcreate callback, move TSC initialization
TSC initialization will soon make use of online_vcpus.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 13 |
1 files changed, 13 insertions, 0 deletions
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; |