summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2012-11-27 23:28:49 -0200
committerMarcelo Tosatti <mtosatti@redhat.com>2012-11-27 23:29:06 -0200
commitb01578de45614c085be319229a52774b61ffe6fb (patch)
tree8b62c15388702fba531d55da29d988c274df0236 /arch/x86
parent7069ed67635b8d574541af426d752cd7fbd465a6 (diff)
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: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/pvclock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c
index 42eb3300dfc6..12e47e210491 100644
--- a/arch/x86/kernel/pvclock.c
+++ b/arch/x86/kernel/pvclock.c
@@ -97,10 +97,10 @@ cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src)
do {
version = pvclock_get_time_values(&shadow, src);
- barrier();
+ rdtsc_barrier();
offset = pvclock_get_nsec_offset(&shadow);
ret = shadow.system_timestamp + offset;
- barrier();
+ rdtsc_barrier();
} while (version != src->version);
if ((valid_flags & PVCLOCK_TSC_STABLE_BIT) &&