Commit 189e1173 authored by Marcelo Tosatti's avatar Marcelo Tosatti

x86: pvclock: add note about rdtsc barriers

As noted by Gleb, not advertising SSE2 support implies
no RDTSC barriers.
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent 2697902b
...@@ -74,6 +74,12 @@ unsigned __pvclock_read_cycles(const struct pvclock_vcpu_time_info *src, ...@@ -74,6 +74,12 @@ unsigned __pvclock_read_cycles(const struct pvclock_vcpu_time_info *src,
u8 ret_flags; u8 ret_flags;
version = src->version; 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(); rdtsc_barrier();
offset = pvclock_get_nsec_offset(src); offset = pvclock_get_nsec_offset(src);
ret = src->system_time + offset; ret = src->system_time + offset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment