Merge branch 'linus' into x86/hyperv
[sfrench/cifs-2.6.git] / arch / x86 / kernel / cpu / mshyperv.c
index c656d92cd708f8aac790968e6b38714aacdf6ecc..caa032ce3fe311507e6168f4ec0a0d742cf7a0b9 100644 (file)
@@ -290,7 +290,12 @@ static void __init ms_hyperv_init_platform(void)
        machine_ops.shutdown = hv_machine_shutdown;
        machine_ops.crash_shutdown = hv_machine_crash_shutdown;
 #endif
-       mark_tsc_unstable("running on Hyper-V");
+       if (ms_hyperv.features & HV_X64_ACCESS_TSC_INVARIANT) {
+               wrmsrl(HV_X64_MSR_TSC_INVARIANT_CONTROL, 0x1);
+               setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
+       } else {
+               mark_tsc_unstable("running on Hyper-V");
+       }
 
        /*
         * Generation 2 instances don't support reading the NMI status from