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: Clean up early time setup.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Clean up early time setup.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 16 Dec 2008 22:30:49 -0800
Delivery-date: Tue, 16 Dec 2008 22:31:58 -0800
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 1229001019 0
# Node ID 1391e1a444c2e986322d72258c0e92eaa2268168
# Parent  33ae75b60de289bb72d8480dddea55dd07c032ab
x86: Clean up early time setup.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/time.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff -r 33ae75b60de2 -r 1391e1a444c2 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Thu Dec 11 13:09:59 2008 +0000
+++ b/xen/arch/x86/time.c       Thu Dec 11 13:10:19 2008 +0000
@@ -1125,19 +1125,19 @@ void init_percpu_time(void)
 /* Late init function (after all CPUs are booted). */
 int __init init_xen_time(void)
 {
-    /* check if TSC is invariant during deep C state
-       this is a new feature introduced by Nehalem*/
+    /* Is TSC invariant during deep C state? */
     if ( cpuid_edx(0x80000007) & (1u<<8) )
         tsc_invariant = 1;
 
     open_softirq(TIME_CALIBRATE_SOFTIRQ, local_time_calibration);
 
+    /* NB. get_cmos_time() can take over one second to execute. */
+    do_settime(get_cmos_time(), 0, NOW());
+
+    stime_platform_stamp = NOW();
+    init_platform_timer();
+
     init_percpu_time();
-
-    stime_platform_stamp = 0;
-    init_platform_timer();
-
-    do_settime(get_cmos_time(), 0, NOW());
 
     return 0;
 }
@@ -1146,9 +1146,12 @@ int __init init_xen_time(void)
 /* Early init function. */
 void __init early_time_init(void)
 {
+    struct cpu_time *t = &this_cpu(cpu_time);
     u64 tmp = init_pit_and_calibrate_tsc();
 
-    set_time_scale(&this_cpu(cpu_time).tsc_scale, tmp);
+    /* So we can use get_s_time() during early boot. */
+    set_time_scale(&t->tsc_scale, tmp);
+    rdtscll(t->local_tsc_stamp);
 
     do_div(tmp, 1000);
     cpu_khz = (unsigned long)tmp;

_______________________________________________
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: Clean up early time setup., Xen patchbot-unstable <=