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

[Xen-changelog] [xen-4.1-testing] x86/tsc: Remove incorrect assertion from cstate_restore_tsc()...



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1305549448 -3600
# Node ID 58a1942959bf56ffdc62d2eb7f81b9eb4793837e
# Parent  d25493176abea50c85d28cca063ee7dee57582f1
x86/tsc: Remove incorrect assertion from cstate_restore_tsc()...

..fix and move to write_tsc().

Signed-off-by: Keir Fraser <keir@xxxxxxx>
xen-unstable changeset:   23342:16d12acccacf
xen-unstable date:        Mon May 16 13:24:05 2011 +0100
---


diff -r d25493176abe -r 58a1942959bf xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c    Mon May 16 13:36:45 2011 +0100
+++ b/xen/arch/x86/smpboot.c    Mon May 16 13:37:28 2011 +0100
@@ -185,7 +185,12 @@
         while ( atomic_read(&tsc_count) != ((i<<1)-1) )
             cpu_relax();
         rmb();
-        write_tsc(tsc_value);
+        /*
+         * If a CPU has been physically hotplugged, we may as well write
+         * to its TSC in spite of X86_FEATURE_TSC_RELIABLE. The platform does
+         * not sync up a new CPU's TSC for us.
+         */
+        __write_tsc(tsc_value);
         atomic_inc(&tsc_count);
     }
 }
diff -r d25493176abe -r 58a1942959bf xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Mon May 16 13:36:45 2011 +0100
+++ b/xen/arch/x86/time.c       Mon May 16 13:37:28 2011 +0100
@@ -683,8 +683,6 @@
     if ( boot_cpu_has(X86_FEATURE_NONSTOP_TSC) )
         return;
 
-    ASSERT(boot_cpu_has(X86_FEATURE_TSC_RELIABLE));
-
     write_tsc(stime2tsc(read_platform_stime()));
 }
 
diff -r d25493176abe -r 58a1942959bf xen/include/asm-x86/msr.h
--- a/xen/include/asm-x86/msr.h Mon May 16 13:36:45 2011 +0100
+++ b/xen/include/asm-x86/msr.h Mon May 16 13:37:28 2011 +0100
@@ -87,7 +87,13 @@
 } while(0)
 #endif
 
-#define write_tsc(val) wrmsrl(MSR_IA32_TSC, val)
+#define __write_tsc(val) wrmsrl(MSR_IA32_TSC, val)
+#define write_tsc(val) ({                                       \
+    /* Reliable TSCs are in lockstep across all CPUs. We should \
+     * never write to them. */                                  \
+    ASSERT(!boot_cpu_has(X86_FEATURE_TSC_RELIABLE));            \
+    __write_tsc(val);                                           \
+})
 
 #define write_rdtscp_aux(val) wrmsr(MSR_TSC_AUX, (val), 0)
 

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


 


Rackspace

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