From: Marcelo Tosatti Date: Wed, 28 Nov 2012 01:28:53 +0000 (-0200) Subject: x86: pvclock: add note about rdtsc barriers X-Git-Tag: omap-for-v3.8/fixes-for-merge-window-v4-signed~27^2~32 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=189e11731aa858597095fbe1e6d243bad26bd96b;p=pandora-kernel.git x86: pvclock: add note about rdtsc barriers As noted by Gleb, not advertising SSE2 support implies no RDTSC barriers. Signed-off-by: Marcelo Tosatti --- diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h index ea27a8dd189c..63f91679af73 100644 --- a/arch/x86/include/asm/pvclock.h +++ b/arch/x86/include/asm/pvclock.h @@ -74,6 +74,12 @@ unsigned __pvclock_read_cycles(const struct pvclock_vcpu_time_info *src, u8 ret_flags; version = src->version; + /* Note: emulated platforms which do not advertise SSE2 support + * result in kvmclock not using the necessary RDTSC barriers. + * Without barriers, it is possible that RDTSC instruction reads from + * the time stamp counter outside rdtsc_barrier protected section + * below, resulting in violation of monotonicity. + */ rdtsc_barrier(); offset = pvclock_get_nsec_offset(src); ret = src->system_time + offset;