summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorMarcelo Tosatti2012-11-28 02:29:02 +0100
committerMarcelo Tosatti2012-11-28 02:29:14 +0100
commit42897d866b120547777ae1fd316680ec53356d9c (patch)
tree29eb544b4361d964dab0d1b3e27f9f2e64597daf /arch/x86/kvm/x86.c
parentKVM: x86: implement PVCLOCK_TSC_STABLE_BIT pvclock flag (diff)
downloadkernel-qcow2-linux-42897d866b120547777ae1fd316680ec53356d9c.tar.gz
kernel-qcow2-linux-42897d866b120547777ae1fd316680ec53356d9c.tar.xz
kernel-qcow2-linux-42897d866b120547777ae1fd316680ec53356d9c.zip
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.c13
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)
return r;
}
+int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
+{
+ int r;
+
+ r = vcpu_load(vcpu);
+ if (r)
+ return r;
+ kvm_write_tsc(vcpu, 0);
+ vcpu_put(vcpu);
+
+ return r;
+}
+
void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
{
int r;