Commit b01578de authored by Marcelo Tosatti's avatar Marcelo Tosatti

x86: pvclock: make sure rdtsc doesnt speculate out of region

Originally from Jeremy Fitzhardinge.

pvclock_get_time_values, which contains the memory barriers
will be removed by next patch.
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent 7069ed67
...@@ -97,10 +97,10 @@ cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) ...@@ -97,10 +97,10 @@ cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src)
do { do {
version = pvclock_get_time_values(&shadow, src); version = pvclock_get_time_values(&shadow, src);
barrier(); rdtsc_barrier();
offset = pvclock_get_nsec_offset(&shadow); offset = pvclock_get_nsec_offset(&shadow);
ret = shadow.system_timestamp + offset; ret = shadow.system_timestamp + offset;
barrier(); rdtsc_barrier();
} while (version != src->version); } while (version != src->version);
if ((valid_flags & PVCLOCK_TSC_STABLE_BIT) && if ((valid_flags & PVCLOCK_TSC_STABLE_BIT) &&
......
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