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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86/tsc: Remove incorrect assertion from cstate_restore_tsc()...
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Wed, 18 May 2011 07:25:16 +0100
Delivery-date: Tue, 17 May 2011 23:25:37 -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 1305548645 -3600
# Node ID 16d12acccacf09126562ca16f91bd2532bba1e9b
# Parent  87084ca76c9c24ab0306d39a70d5daa65edf09ba
x86/tsc: Remove incorrect assertion from cstate_restore_tsc()...

..fix and move to write_tsc().

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 87084ca76c9c -r 16d12acccacf xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c    Mon May 16 13:13:41 2011 +0100
+++ b/xen/arch/x86/smpboot.c    Mon May 16 13:24:05 2011 +0100
@@ -175,7 +175,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 87084ca76c9c -r 16d12acccacf xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Mon May 16 13:13:41 2011 +0100
+++ b/xen/arch/x86/time.c       Mon May 16 13:24:05 2011 +0100
@@ -686,8 +686,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 87084ca76c9c -r 16d12acccacf xen/include/asm-x86/msr.h
--- a/xen/include/asm-x86/msr.h Mon May 16 13:13:41 2011 +0100
+++ b/xen/include/asm-x86/msr.h Mon May 16 13:24:05 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-unstable] x86/tsc: Remove incorrect assertion from cstate_restore_tsc()..., Xen patchbot-unstable <=