x86: When Xen is notified that CPU frequency has changed, do not trust
authorKeir Fraser <keir.fraser@citrix.com>
Sat, 26 Jan 2008 11:29:29 +0000 (11:29 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Sat, 26 Jan 2008 11:29:29 +0000 (11:29 +0000)
the current TSC-extrapolated time when we re-sync.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/time.c

index 3793c4bb2cbb58c98447ad7c1e07e99016c9ad41..e079138b239bce710c2454a13b6fd822cfd9f60a 100644 (file)
@@ -732,8 +732,10 @@ int cpu_frequency_change(u64 freq)
     local_irq_disable();
     rdtscll(curr_tsc);
     t->local_tsc_stamp = curr_tsc;
-    t->stime_local_stamp = get_s_time();
     t->stime_master_stamp = read_platform_stime();
+    /* TSC-extrapolated time may be bogus after frequency change. */
+    /*t->stime_local_stamp = get_s_time();*/
+    t->stime_local_stamp = t->stime_master_stamp;
     set_time_scale(&t->tsc_scale, freq);
     local_irq_enable();