KVM: x86: Warn about unstable TSC
authorZachary Amsden <zamsden@redhat.com>
Fri, 20 Aug 2010 08:07:22 +0000 (22:07 -1000)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:51:22 +0000 (10:51 +0200)
If creating an SMP guest with unstable host TSC, issue a warning

Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/x86.c

index 699c6b8..a8dee58 100644 (file)
@@ -5457,6 +5457,10 @@ void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
 struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
                                                unsigned int id)
 {
+       if (check_tsc_unstable() && atomic_read(&kvm->online_vcpus) != 0)
+               printk_once(KERN_WARNING
+               "kvm: SMP vm created on host with unstable TSC; "
+               "guest TSC will not be reliable\n");
        return kvm_x86_ops->vcpu_create(kvm, id);
 }