..fix and move to write_tsc().
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 23342:
16d12acccacf
xen-unstable date: Mon May 16 13:24:05 2011 +0100
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);
}
}
if ( boot_cpu_has(X86_FEATURE_NONSTOP_TSC) )
return;
- ASSERT(boot_cpu_has(X86_FEATURE_TSC_RELIABLE));
-
write_tsc(stime2tsc(read_platform_stime()));
}
} 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)