[PATCH SRU t/u/v] x86/hyperv: Mark the Hyper-V TSC as unstable

tim.gardner at canonical.com tim.gardner at canonical.com
Wed Oct 21 19:32:08 UTC 2015


From: Vitaly Kuznetsov <vkuznets at redhat.com>

BugLink: http://bugs.launchpad.net/bugs/1498206

The Hyper-V top-level functional specification states, that
"algorithms should be resilient to sudden jumps forward or
backward in the TSC value", this means that we should consider
TSC as unstable. In some cases tsc tests are able to detect the
instability, it was detected in 543 out of 646 boots in my
testing:

 Measured 6277 cycles TSC warp between CPUs, turning off TSC clock.
 tsc: Marking TSC unstable due to check_tsc_sync_source failed

This is, however, just a heuristic. On Hyper-V platform there
are two good clocksources: MSR-based hyperv_clocksource and
recently introduced TSC page.

Signed-off-by: Vitaly Kuznetsov <vkuznets at redhat.com>
Cc: Haiyang Zhang <haiyangz at microsoft.com>
Cc: K. Y. Srinivasan <kys at microsoft.com>
Cc: Linus Torvalds <torvalds at linux-foundation.org>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Thomas Gleixner <tglx at linutronix.de>
Cc: devel at linuxdriverproject.org
Link: http://lkml.kernel.org/r/1440003264-9949-1-git-send-email-vkuznets@redhat.com
Signed-off-by: Ingo Molnar <mingo at kernel.org>
(cherry picked from commit 88c9281a9fba67636ab26c1fd6afbc78a632374f)
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
---
 arch/x86/kernel/cpu/mshyperv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 8915833..8906637 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -103,6 +103,7 @@ static void __init ms_hyperv_init_platform(void)
 	no_timer_check = 1;
 #endif
 
+	mark_tsc_unstable("running on Hyper-V");
 }
 
 const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
-- 
1.9.1





More information about the kernel-team mailing list