]> xenbits.xensource.com Git - xen.git/commitdiff
x86/time: tsc_check_writability() may need to be run a second time
authorJan Beulich <jbeulich@suse.com>
Mon, 13 Feb 2017 14:21:24 +0000 (15:21 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 13 Feb 2017 14:21:24 +0000 (15:21 +0100)
While we shouldn't remove its current invocation, we need to re-run it
for the case that the X86_FEATURE_TSC_RELIABLE feature flag has been
cleared, in order to avoid using the TSC rendezvous function in case
the TSC can't be written.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
xen/arch/x86/time.c

index 699dfb6604eaf112b0e8a8338b82455d69f57b35..803e154c99aa8bbaed6c728f612d03e94f5dd38d 100644 (file)
@@ -1642,6 +1642,14 @@ static int __init verify_tsc_reliability(void)
         }
     }
 
+    /*
+     * Re-run the TSC writability check if it didn't run to completion, as
+     * X86_FEATURE_TSC_RELIABLE may have been cleared by now. This is needed
+     * for determining which rendezvous function to use (below).
+     */
+    if ( !disable_tsc_sync )
+        tsc_check_writability();
+
     /*
      * While with constant-rate TSCs the scale factor can be shared, when TSCs
      * are not marked as 'reliable', re-sync during rendezvous.