[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/time: correctly honor late clearing of TSC related feature flags



commit 63e1d01b8fd948b3e0fa3beea494e407668aa43b
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Feb 7 14:32:40 2017 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Feb 7 14:32:40 2017 +0100

    x86/time: correctly honor late clearing of TSC related feature flags
    
    As such clearing of flags may have an impact on the selected rendezvous
    function, defer the establishing of a rendezvous function other than
    the initial default one (std) until after all APs have been brought up.
    
    But don't allow such feature flags to be cleared during CPU hotplug:
    Platform and local system times may have diverged significantly by
    then, potentially causing noticeably (even if only temporary) strange
    behavior. As we're anyway expecting only sufficiently similar CPUs to
    appear during hotplug, this shouldn't be introducing new limitations.
    
    Reported-by: Joao Martins <joao.m.martins@xxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/time.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index e17da1b..d3b0c69 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1638,9 +1638,18 @@ static int __init verify_tsc_reliability(void)
 
             printk("Switched to Platform timer %s TSC\n",
                    freq_string(plt_src.frequency));
+            return 0;
         }
     }
 
+    /*
+     * While with constant-rate TSCs the scale factor can be shared, when TSCs
+     * are not marked as 'reliable', re-sync during rendezvous.
+     */
+    if ( boot_cpu_has(X86_FEATURE_CONSTANT_TSC) &&
+         !boot_cpu_has(X86_FEATURE_TSC_RELIABLE) )
+        time_calibration_rendezvous_fn = time_calibration_tsc_rendezvous;
+
     return 0;
 }
 __initcall(verify_tsc_reliability);
@@ -1650,14 +1659,6 @@ int __init init_xen_time(void)
 {
     tsc_check_writability();
 
-    /* If we have constant-rate TSCs then scale factor can be shared. */
-    if ( boot_cpu_has(X86_FEATURE_CONSTANT_TSC) )
-    {
-        /* If TSCs are not marked as 'reliable', re-sync during rendezvous. */
-        if ( !boot_cpu_has(X86_FEATURE_TSC_RELIABLE) )
-            time_calibration_rendezvous_fn = time_calibration_tsc_rendezvous;
-    }
-
     open_softirq(TIME_CALIBRATE_SOFTIRQ, local_time_calibration);
 
     /* NB. get_cmos_time() can take over one second to execute. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.