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] x86/tsc: Remove incorrect assertion fr

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.1-testing] x86/tsc: Remove incorrect assertion from cstate_restore_tsc()...
From: Xen patchbot-4.1-testing <patchbot@xxxxxxx>
Date: Mon, 16 May 2011 23:25:10 +0100
Delivery-date: Mon, 16 May 2011 15:25:27 -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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.1-testing] x86/tsc: Remove incorrect assertion from cstate_restore_tsc()..., Xen patchbot-4 . 1-testing <=