WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-4.1-testing] xen: Move tsc reliability check until

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.1-testing] xen: Move tsc reliability check until after CPUs have booted
From: Xen patchbot-4.1-testing <patchbot@xxxxxxx>
Date: Sat, 17 Sep 2011 18:44:09 +0100
Delivery-date: Sat, 17 Sep 2011 10:44:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User George Dunlap <george.dunlap@xxxxxxxxxxxxx>
# Date 1316273876 -3600
# Node ID c5554f952a82c5d6bc1989b3035a69ad9904203d
# Parent  4a401bdaeb5b2d87312fa622dd61006e993ca5b4
xen: Move tsc reliability check until after CPUs have booted

AMD CPUs by default enable X86_FEATURE_TSC_RELIABLE, and depend upon a
later check to disable this feature if TSC drift is detected.
Unfortunately, this check is done in time.c:init_xen_time(), which is
done before any secondary CPUs are brought up, and is thus guaranteed
to succed.

This patch moves the check into its own function, and calls it after
cpus are brought up.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
xen-unstable changeset:   23846:bf2aaf21e8e7
xen-unstable date:        Sat Sep 17 16:22:54 2011 +0100
---


diff -r 4a401bdaeb5b -r c5554f952a82 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Sat Sep 17 16:35:21 2011 +0100
+++ b/xen/arch/x86/setup.c      Sat Sep 17 16:37:56 2011 +0100
@@ -1266,8 +1266,11 @@
     printk("Brought up %ld CPUs\n", (long)num_online_cpus());
     smp_cpus_done(max_cpus);
 
+    verify_tsc_reliability();
+
     do_initcalls();
 
+
     if ( opt_watchdog ) 
         watchdog_enable();
     
diff -r 4a401bdaeb5b -r c5554f952a82 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Sat Sep 17 16:35:21 2011 +0100
+++ b/xen/arch/x86/time.c       Sat Sep 17 16:37:56 2011 +0100
@@ -1445,8 +1445,8 @@
     disable_tsc_sync = 1;
 }
 
-/* Late init function (after all CPUs are booted). */
-int __init init_xen_time(void)
+/* Late init function, after all cpus have booted */
+void __init verify_tsc_reliability(void)
 {
     if ( boot_cpu_has(X86_FEATURE_TSC_RELIABLE) )
     {
@@ -1458,9 +1458,17 @@
          */
         tsc_check_reliability();
         if ( tsc_max_warp )
+        {
+            printk("%s: TSC warp detected, disabling TSC_RELIABLE\n",
+                   __func__);
             setup_clear_cpu_cap(X86_FEATURE_TSC_RELIABLE);
+        }
     }
+}
 
+/* Late init function (after interrupts are enabled). */
+int __init init_xen_time(void)
+{
     tsc_check_writability();
 
     /* If we have constant-rate TSCs then scale factor can be shared. */
diff -r 4a401bdaeb5b -r c5554f952a82 xen/include/xen/time.h
--- a/xen/include/xen/time.h    Sat Sep 17 16:35:21 2011 +0100
+++ b/xen/include/xen/time.h    Sat Sep 17 16:37:56 2011 +0100
@@ -11,6 +11,7 @@
 #include <xen/types.h>
 #include <public/xen.h>
 
+extern void verify_tsc_reliability(void);
 extern int init_xen_time(void);
 extern void cstate_restore_tsc(void);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.1-testing] xen: Move tsc reliability check until after CPUs have booted, Xen patchbot-4 . 1-testing <=