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: Ensure TSC calibration stats are sam

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Ensure TSC calibration stats are same across all CPUs when
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Jul 2008 17:40:08 -0700
Delivery-date: Tue, 15 Jul 2008 17:39:57 -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.fraser@xxxxxxxxxx>
# Date 1216141020 -3600
# Node ID 64b55f15a0554a6cb08c60dc8da240449b2da973
# Parent  64d8a24d28f68eb0067d982b401b1b478e590194
x86: Ensure TSC calibration stats are same across all CPUs when
running with clocksource=tsc.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/time.c |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff -r 64d8a24d28f6 -r 64b55f15a055 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Tue Jul 15 17:56:25 2008 +0100
+++ b/xen/arch/x86/time.c       Tue Jul 15 17:57:00 2008 +0100
@@ -496,11 +496,27 @@ static u64 read_tsc_count(void)
 
 static int init_tsctimer(struct platform_timesource *pts)
 {
-    /* TODO: evaluate stability of TSC here, return 0 if not stable. */
+    unsigned int cpu;
+
+    /*
+     * TODO: evaluate stability of TSC here, return 0 if not stable.
+     * For now we assume all TSCs are synchronised and hence can all share
+     * CPU 0's calibration values.
+     */
+    for_each_cpu ( cpu )
+    {
+        if ( cpu == 0 )
+            continue;
+        memcpy(&per_cpu(cpu_time, cpu),
+               &per_cpu(cpu_time, 0),
+               sizeof(struct cpu_time));
+    }
+
     pts->name = "TSC";
     pts->frequency = tsc_freq;
     pts->read_counter = read_tsc_count;
     pts->counter_bits = 64;
+
     return 1;
 }
 
@@ -1130,11 +1146,12 @@ int time_suspend(void)
 
 int time_resume(void)
 {
-    u64 tmp = init_pit_and_calibrate_tsc();
+    /*u64 tmp = */init_pit_and_calibrate_tsc();
 
     disable_pit_irq();
 
-    set_time_scale(&this_cpu(cpu_time).tsc_scale, tmp);
+    /* Disable this while calibrate_tsc_ap() also is skipped. */
+    /*set_time_scale(&this_cpu(cpu_time).tsc_scale, tmp);*/
 
     resume_platform_timer();
 

_______________________________________________
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: Ensure TSC calibration stats are same across all CPUs when, Xen patchbot-unstable <=